# Approvals

Some actions are sensitive enough that a human should see them before they happen — publishing an app, storing a credential, sharing workspace access, deleting something permanently, equipping a skill. The platform's catalog marks each tool with an approval posture — never, always, or conditional — and the ones that need it produce an **approval card** instead of running immediately.

## What an approval card is

A card names the action and shows the human a readable summary of what would happen — with any secret fields redacted before they're ever rendered, so a stored password never appears in a card, even the approving human's own — and offers Approve / Deny. Approving carries the exact call out automatically; nothing needs to be re-typed or re-requested.

## What happens when an agent tries a gated action

The first attempt at a gated action with no prior approval doesn't dead-end. The platform creates a bound approval card for that exact call and returns a typed `approval_requested` result: the action needs one-time human approval, a card now exists, and the agent doesn't need to retry — the call runs automatically once approved, with the result showing up in the chat.

**What to do on `approval_requested`:** tell the user plainly that the action needs their approval and that nothing further is needed from you — don't loop retrying the same call, and don't try to work around it with a different tool or a hand-rolled equivalent. If the user asks why nothing happened yet, that's the honest answer: it's waiting on their click.

Retrying an identical call while a card is still pending doesn't spawn a second card — it's recognized as the same request and returns the same one.

## Signing in with a stored login

`credentials.fill_browser_field` types a stored password into the agent's browser. The agent never sees it.

- **A login bound to origins** (every login made with `credentials.generate_password`, and every login after its first approved sign-in) signs in with no card. The password is typed only when the browser page is on one of those origins. A lookalike page gets nothing, and the call is refused.
- **A login with no bound origin** (an older `credentials.store` login) asks once. The card says "<agent> wants to sign in to <site> as <login>". Approve it, and the login is bound to that origin: later sign-ins there need no card.
- **A one-time 2FA code** for a bound login needs no card. The person typed it for this sign-in.
- A pending login, another origin and a computer shared with a child chat are always refused. Every sign-in writes a `credential.browser_fill` event (who, origin, login, chat), never the password.

## What a card shows

A card shows what the agent wants to do in words first. The exact input of the call is under **Details**.

## Calls from the CLI, MCP or API

A call from the Astral CLI, from an MCP client or straight to `/api/v1` has no chat, so it can not show a card. When the workspace rules say such a call needs approval, it stops with the error `approval_required` (CLI exit code `10`), with `details.reason` set to `chat_approval_required`. Nothing changes.

- **An outside agent or a script:** tell the person that the call needs their approval in Astral. They can ask an Astral agent in a chat to make the same call, and approve the card there.
- **An Astral agent in a chat:** if the CLI on your computer returns `approval_required`, call the same tool directly in the chat. That makes the card.

## Never invent credentials to get around approval

Approval exists precisely for actions a model shouldn't be able to complete purely by trying hard enough. There's no legitimate path that involves fabricating an approval, a token, or a credential to make a gated action run anyway — if something needs a human's yes, the only way through is to actually get it.
