← Cards

Issue store credit authority

card-store-credits

Active
KIFF
support-agent
Authority
ISSUE_STORE_CREDIT
€2,000per calendar day €1,250remaining

Authority

Ceiling
€2,000 per calendar day
Used
€750
Remaining
€1,250

Holder

Scope

Domain
retention-credit · production
Can do
ISSUE_STORE_CREDIT
Only when
ELIGIBLE
Expiry
15 Feb 2027
Connect this card to your agent Your agent has to ask KIFF before it acts. That is a change to your agent's code, best made with your coding agent or with a KIFF engineer.

Recommended

With your coding agent

Paste this into Claude Code, or another coding agent, in the repository where your agent runs. It already contains this card's agent name, domain and limit.

Connect my agent to its KIFF card, so the agent asks KIFF before it acts and only acts when KIFF allows it.

Card: card-store-credits
Agent name, sent as actor_id: support-agent
Domain: retention-credit
Action: ISSUE_STORE_CREDIT (issue store credit)
Limit: €2,000 per calendar day, summed over the amount_cents parameter (euro cents)

Steps:
1. Find the place in this codebase where the agent performs this action. Explain it to me before changing anything.
2. Just before it runs, call POST https://api.kiff.dev/v1/proposals/decide with header "Authorization: Bearer $KIFF_CLOUD_API_KEY" and this JSON body:
   {"action_name": "ISSUE_STORE_CREDIT", "actor_id": "support-agent", "domain": "retention-credit", "entity_id": "<the retention case id>", "entity_type": "RetentionCase", "parameters": {"amount_cents":"<amount_cents>"}}
3. Run the action only when the response's "outcome" is "allowed". On anything else, do not run it and surface "reasons" and "message" (for example mandate_limit_reached means the card's limit would be exceeded).
4. KIFF decides against the entity's current state, so the system must also report that entity's events to POST https://api.kiff.dev/v1/events/raw?domain=retention-credit. Check with me which events we already emit.
5. Read the key from the environment variable KIFF_CLOUD_API_KEY and never hard-code it. Ask me for it. The key must hold the "support" role, or KIFF refuses the action on permissions before it checks the card (I can create one with that role on the card's page in KIFF). It must also be the key issued for support-agent: KIFF refuses a key issued for another agent (actor_not_key_holder), and a key not issued for any agent wherever a card is drawn on (key_not_bound_to_agent).
6. Add a test for the allowed and the refused path.

Reference: https://kiff.dev/docs/five-line-integration and https://kiff.dev/llms.txt

Your agent also needs its own API key: one with the support role that can act only as support-agent. A key from the API keys page is not tied to this agent and is refused.

With a KIFF engineer

For your first cards, a KIFF engineer can set this up with you: find where your agent acts, connect it, and check the first real decisions together.

Ask for guided setup

Try it now

Send one real request as support-agent on a new test retentioncase. It draws €1 from today's balance and shows up in this card's statement.