Approvals
An agent can do with the API what its key can do. A change to what protects a project does not run on the agent’s word alone: the API refuses it, you approve that exact request in the dashboard, and the agent sends it again. It runs once.Which credentials wait
- A CLI sign-in, the credential
promptguard loginholds. A coding agent in your terminal can use it, so it is always treated as an agent’s. - An API key marked for an agent: tick For an agent: risky changes wait for your approval when you create it, or send
"for_agent": trueto create it over the API. Every key it creates is marked too, and so is its replacement when you rotate it.
agent_key_change_refused. It may end itself.
Which changes wait
A request that changes nothing runs at once, and so does a guardrail or overlay change that tightens protection. One the API cannot place, such as another way of masking personal data, waits.
Ask, approve, retry
1. The agent asks. The request is refused, and nothing has changed:approval_url, signed in as yourself. The page shows the change in full, who asked, and the organization and project. A change too large to show is refused with approval_change_too_large. Characters that cannot be seen, and spaces a page would collapse, are spelled out, and text that is not ASCII is followed by its escapes. Only the person the key belongs to can decide, in their own dashboard session, with the role the same change takes there and whatever two-step verification the organization requires. You have 30 minutes.
3. The agent sends the same request again, with the same method, path, query and body, within ten minutes of your approval:
approval_invalid. So is a retry when anything it would change is not as it was when the agent asked: an approval never undoes what you changed since. Asking for the same change while it waits gives the same approval, and you can have ten waiting at once in an organization. An approval can be read for seven days.
Asking, deciding and running are each recorded in the audit log.
Endpoints
Both answer the API key that asked, whatever its scopes. To any other key, the approval does not exist (404 approval_not_found).
Get an approval
status is pending, approved, declined, cancelled, used or expired. While it is pending, wait the seconds in the Retry-After header before asking again. expires_at is when your time to decide runs out, and once approved, when the agent’s time to use it does.
Cancel an approval
409 approval_not_pending.
Without a dashboard
A self-hosted data plane has no dashboard to approve in, so it refuses such a change withapproval_unavailable. Make it in the dashboard that manages the data plane.