ApprovalCard

The agent asks a human to decide. Exactly two outcomes; both fire actions carrying hand-picked context. The card disables itself after a decision.

rendered, live
the wire — click a line to scrub
the contract — ApprovalCard in catalog.json
{
  "type": "object",
  "description": "The agent asks a human to decide. Exactly two outcomes; both fire actions carrying hand-picked context. The card disables itself after a decision.",
  "properties": {
    "component": {
      "const": "ApprovalCard"
    },
    "title": {
      "$ref": "https://a2ui.org/specification/v1_0/common_types.json#/$defs/DynamicString",
      "description": "The decision being asked, as a short question, e.g. \"Roll back payments-api?\"."
    },
    "summary": {
      "$ref": "https://a2ui.org/specification/v1_0/common_types.json#/$defs/DynamicString",
      "description": "One or two sentences of context the human needs to decide. Inline markdown allowed."
    },
    "details": {
      "type": "string",
      "description": "Optional ComponentId of extra content rendered collapsed inside the card (any component, e.g. a DataTable of affected services)."
    },
    "approveAction": {
      "$ref": "https://a2ui.org/specification/v1_0/common_types.json#/$defs/Action",
      "description": "Fired on approve. Put only what you need to act on in the context — the decision payload, not the world."
    },
    "rejectAction": {
      "$ref": "https://a2ui.org/specification/v1_0/common_types.json#/$defs/Action",
      "description": "Fired on reject. Same context discipline as approveAction."
    },
    "requireComment": {
      "type": "boolean",
      "default": false,
      "description": "When true, the card requires a comment before either decision; the renderer adds `comment` (string) to the fired action's context."
    },
    "approveLabel": {
      "$ref": "https://a2ui.org/specification/v1_0/common_types.json#/$defs/DynamicString",
      "description": "Custom label for the approve button. Default is a localized \"Approve\"."
    },
    "rejectLabel": {
      "$ref": "https://a2ui.org/specification/v1_0/common_types.json#/$defs/DynamicString",
      "description": "Custom label for the reject button. Default is a localized \"Reject\"."
    }
  },
  "required": [
    "component",
    "title",
    "summary",
    "approveAction",
    "rejectAction"
  ]
}
the prompt-pack — paste into your agent
### ApprovalCard — ask a human to decide

Exactly two outcomes, each firing an **action**: `{"event": {"name": "...", "context": {...}}}`.
Name the event after what happened; put only what you need to act on in `context` — the decision
payload, not the world. Context values may bind with `{"path": ...}`. When the user decides, you
receive the event with that context (plus `comment` when `requireComment` is true).

| prop             | type    | required | notes                                             |
| ---------------- | ------- | -------- | ------------------------------------------------- |
| `title`          | string  | yes      | the decision, as a short question                 |
| `summary`        | string  | yes      | 1–2 sentences of context; inline markdown allowed |
| `details`        | id      | no       | ComponentId of extra content, rendered collapsed  |
| `approveAction`  | action  | yes      | fired on approve                                  |
| `rejectAction`   | action  | yes      | fired on reject                                   |
| `requireComment` | boolean | no       | default `false`; adds `comment` to the context    |
| `approveLabel`   | string  | no       | default: localized "Approve"                      |
| `rejectLabel`    | string  | no       | default: localized "Reject"                       |

```
{"id":"rollback","component":"ApprovalCard","title":"Roll back payments-api?","summary":"Error rate hit 4.2% after deploy 4190. Rolling back restores build 4189 in ~2 minutes.","requireComment":true,"approveAction":{"event":{"name":"rollback_approved","context":{"deployId":{"path":"/deployId"}}}},"rejectAction":{"event":{"name":"rollback_rejected","context":{"deployId":{"path":"/deployId"}}}}}
```