Skip to main content
The Agents API must be enabled for your platform; until it is, agent endpoints answer 403. To enable it, book a demo or reach out to your Lightspark contact.
Every agent has one policy. Grid evaluates it on every request the agent makes, so your platform does not need its own delegated-access model. Let customers see and change the policy in your product; Grid enforces whatever it says. A policy answers four questions:
  1. What may the agent do? (permissions)
  2. Does it act on its own or ask first? (defaultExecutionMode, approvalThresholds)
  3. How much may it spend? (spendingLimits)
  4. Which accounts may it use? (accountRestrictions)

Example policy

With this policy the agent sends and buys on its own up to $25.00, asks the customer above that, and is refused above $500.00 a payment, $2,000.00 a day, ten payments a day, or $10,000.00 a month.
All amounts are integers in the smallest unit of the policy currency: 50000 with "currency": "USD" is $500.00. When a payment is in another currency, Grid converts it to the policy currency at evaluation time.

Permissions

Grant the smallest set the agent needs. Permissions are an allowlist: anything not granted is refused with 403. Some operations need more than one permission. Payout runs need CREATE_QUOTES and EXECUTE_QUOTES, and MANAGE_EXTERNAL_ACCOUNTS when a row pays a contact. Increasing a purchase card needs ISSUE_CARDS and MANAGE_CARDS.

Execution modes

defaultExecutionMode decides what happens to a payment the policy allows:
  • AUTO: Grid executes it at once.
  • APPROVAL_REQUIRED: Grid creates an AgentAction in PENDING_APPROVAL and waits for your platform to approve or reject it.
Even in AUTO, a payment above approvalThresholds.amount waits for approval. So does a payment above the approval threshold of the agent’s spending pool. Some requests ask regardless of mode: a recurring purchase card always does, and a use of the customer’s stored card does unless the customer chose to auto-approve that merchant (one that needs the security code always does). See Approvals & audit.

Spending limits

spendingLimits caps the agent’s sends and the purchases on cards issued for it. GET /agents/{agentId} and the agent’s own GET /agents/me return usage with the agent’s running counters: dailyTransactionCount, dailySpend, monthlySpend, and when the daily and monthly counters reset (dailyResetDate, monthlyResetMonth). Show these next to the limits so the customer can see how much room is left. A payment over a limit is refused, not held for approval. Since a payment above perTransactionLimit is always refused, set approvalThresholds.amount below it for the threshold to ever ask.

Approval thresholds

approvalThresholds forces approval for larger payments even when defaultExecutionMode is AUTO.

Account restrictions

By default an agent can use all of the customer’s internal accounts. Restrict it with accountRestrictions:
  • allowedAccountIds: the internal accounts the agent may use. null means all of them.
  • accountRules: per-account overrides. Each rule names an accountId and may set its own executionMode and perTransactionLimit (in the policy currency; null inherits the agent’s limit).
The agent can discover the accounts available to it with GET /agents/me/internal-accounts.

Updating a policy

PATCH /agents/{agentId}/policy takes a partial policy. Omitted fields keep their values, and the change takes effect immediately.
  • permissions, when sent, replaces the whole list.
  • Within spendingLimits, only the fields you send change. dailyLimit and monthlyLimit accept null to remove them. currency may be sent only with its current value.
  • The response is the updated Agent.
A policy change applies to decisions made after it. An action already waiting for approval is checked against the policy as it is when it is approved, so lowering a limit can make a pending action fail with POLICY_DENIED.

Practical guidance

  • Start new agents with the fewest permissions and APPROVAL_REQUIRED, and let the customer loosen them.
  • Keep read permissions (VIEW_TRANSACTIONS) separate from money movement (EXECUTE_QUOTES, ISSUE_CARDS).
  • Grant MANAGE_EXTERNAL_ACCOUNTS only when the agent needs to add destinations; a new destination is where most mistakes and most fraud start.
  • Grant USE_STORED_CARDS only after the customer has explicitly chosen to share a card with this agent.
  • Show the current policy and usage in your product, and confirm policy changes with the customer.

Next steps