Skip to content
AX Principles

Artifacts

Artifacts

Ready-to-copy starting points: the manifests, schemas, errors, and headers that implement each principle. Adapt them to your stack.

# Acme
> One-line description of what Acme does.
## Docs
- [Quickstart](https://acme.com/docs/quickstart.md): get running in 5 minutes
- [API reference](https://acme.com/docs/api.md): endpoints and schemas
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"SoftwareApplication","name":"Acme",
 "description":"Acme helps teams do X.","url":"https://acme.com",
 "offers":{"@type":"Offer","price":"29","priceCurrency":"USD"}}
</script>
GET /docs/quickstart HTTP/1.1
Accept: text/markdown
<link rel="alternate" type="text/markdown" href="/docs/quickstart.md">
HTTP/1.1 403 Forbidden
WWW-Authenticate: Bearer error="insufficient_scope", scope="orders:write", resource_metadata="https://acme.com/.well-known/oauth-protected-resource"
Content-Type: application/json

{
  "error": "insufficient_scope",
  "message": "This token cannot write orders.",
  "required_scope": "orders:write",
  "your_scopes": ["orders:read"],
  "grant_at": "https://acme.com/settings/tokens",
  "docs": "https://acme.com/docs/scopes.md"
}
{
  "principal_type": "agent",
  "agent_id": "agt_4f...",
  "owner_user_id": "usr_9a...",
  "scopes": ["orders:read"],
  "revocable": true
}
{
  "name": "Acme",
  "description": "Acme helps teams do X.",
  "auth": { "type": "bearer", "scopes_url": "/docs/scopes.md" },
  "actions": [
    { "name": "search_orders", "method": "GET", "path": "/v1/orders",
      "scopes": ["orders:read"], "description": "Find a customer's orders by email or order ID." },
    { "name": "create_refund", "method": "POST", "path": "/v1/refunds",
      "scopes": ["refunds:write"], "consequential": true,
      "description": "Issue a refund. Irreversible. Supports dry_run." }
  ],
  "docs": "/llms.txt"
}
{
  "order_id": "ord_123",
  "status": "pending_payment",
  "_links": {
    "self":   { "href": "/v1/orders/ord_123" },
    "pay":    { "href": "/v1/orders/ord_123/pay", "method": "POST" },
    "cancel": { "href": "/v1/orders/ord_123/cancel", "method": "POST" }
  }
}
{
  "name": "search_orders",
  "description": "Use this to find a customer's orders by email or order ID. Returns up to 50, newest first. Does not modify anything.",
  "input_schema": {
    "type": "object",
    "properties": {
      "query": { "type": "string", "description": "Email or order ID" },
      "limit": { "type": "integer", "default": 20, "maximum": 50 }
    },
    "required": ["query"]
  },
  "examples": [{ "query": "jane@acme.com", "limit": 10 }]
}
POST /v1/refunds HTTP/1.1
Idempotency-Key: 5f3c...-once-per-intent
X-Dry-Run: true
Content-Type: application/json

{ "order_id": "ord_123", "amount": 4200 }
{ "dry_run": true, "would_refund": 4200, "currency": "usd", "reversible": false,
  "confirm_with": { "header": "X-Dry-Run", "set_to": "false" } }
{
  "error": {
    "code": "rate_limited",
    "message": "Too many requests.",
    "retryable": true,
    "retry_after_seconds": 30,
    "alternative": "Use GET /v1/orders/export for bulk reads.",
    "docs": "https://acme.com/docs/limits.md"
  }
}
{
  "task_id": "task_88a",
  "status": "running",
  "step": 3,
  "of": 5,
  "resumable": true,
  "resume_token": "rt_...",
  "updated_at": "2026-06-04T12:00:00Z"
}
{
  "event": "order.updated",
  "id": "evt_77",
  "occurred_at": "2026-06-04T12:00:00Z",
  "api_version": "2026-06-01",
  "data": { "order_id": "ord_123", "status": "paid" }
}
X-API-Version: 2026-06-01
Deprecation: @1782863999
Link: <https://acme.com/docs/migrate-v2.md>; rel="deprecation"; type="text/markdown"
Sunset: Wed, 31 Dec 2026 23:59:59 GMT
{
  "from_agent": "planner",
  "to_agent": "executor",
  "role": "executor",
  "task": "Issue refund for order ord_123",
  "scope": ["refunds:write"],
  "context": { "order_id": "ord_123", "reason": "duplicate charge" },
  "constraints": { "max_spend_usd": 50, "requires_dry_run": true },
  "return_to": "planner"
}
X-Agent-Request: true
X-Agent-Name: acme-support-bot
X-Agent-Operator: org_acme
User-Agent: acme-support-bot/1.4 (+https://acme.com/agents)
{ "ts": "2026-06-04T12:00:00Z", "agent": "acme-support-bot", "operator": "org_acme",
  "action": "create_refund", "resource": "ord_123", "result": "ok", "reason": "duplicate charge" }
{
  "agent": "acme-support-bot",
  "limits": {
    "requests_per_min": 60,
    "max_spend_usd_per_day": 100,
    "max_actions_per_session": 200,
    "scopes": ["orders:read", "refunds:write"]
  }
}
// Never render agent-produced HTML directly into a trusted page.
// Bad:  element.innerHTML = agentOutput        // injection / XSS
// Bad:  <div dangerouslySetInnerHTML={{__html: agentOutput}} />
// Good: render through a sanitizer with a strict allowlist,
//       or a structured UI spec (for example Google's A2UI), not raw HTML.
const safe = sanitize(agentOutput, { allowedTags: ["b","i","a","p","ul","li","code"] });
{
  "name": "cancel_subscription",
  "description": "Cancel a customer's subscription at the end of the current billing period.",
  "inputSchema": {
    "type": "object",
    "properties": { "subscription_id": { "type": "string" } },
    "required": ["subscription_id"]
  },
  "annotations": {
    "readOnlyHint": false,
    "destructiveHint": true,
    "idempotentHint": true,
    "openWorldHint": false
  }
}
{
  "resultType": "task",
  "taskId": "786512e2-9e0d-44bd-8f29-789f320fe840",
  "status": "working",
  "createdAt": "2025-11-25T10:30:00Z",
  "lastUpdatedAt": "2025-11-25T10:40:00Z",
  "ttlMs": 60000,
  "pollIntervalMs": 5000
}
{
  "resultType": "input_required",
  "inputRequests": {
    "github_login": {
      "method": "elicitation/create",
      "params": {
        "mode": "form",
        "message": "Please provide your GitHub username",
        "requestedSchema": {
          "type": "object",
          "properties": { "name": { "type": "string" } },
          "required": ["name"]
        }
      }
    }
  },
  "requestState": "AEAD-protected blob"
}
# Bad: the agent's path becomes part of the command line
os.system(f"tar -czf backup.tgz {args['path']}")
cursor.execute(f"SELECT * FROM orders WHERE customer = '{args['customer']}'")

# Good: arguments stay data
subprocess.run(["tar", "-czf", "backup.tgz", "--", args["path"]], check=True)
cursor.execute("SELECT * FROM orders WHERE customer = %s", (args["customer"],))
{
  "resultType": "input_required",
  "inputRequests": {
    "api_key": {
      "method": "elicitation/create",
      "params": {
        "mode": "url",
        "url": "https://mcp.example.com/ui/set_api_key",
        "message": "Please provide your API key to continue."
      }
    }
  },
  "requestState": "AEAD-protected blob"
}
GET /products/42 HTTP/1.1
Host: shop.example.com
Signature-Agent: "https://signature-agent.test"
Signature-Input: sig2=("@authority" "signature-agent");created=1735689600;keyid="poqkLGiymh_W0uP6PZFw-dvez3QJT5SolqXBCW38r0U";alg="ed25519";expires=1735693200;tag="web-bot-auth"
Signature: sig2=:jdq0SqOwHdyHr9+r5jw3iYZH6aNGKijYp/EstF4RQTQdi5N5YYKrD+mCT1HA1nZDsi6nJKuHxUi/5Syp3rLWBA==:
{
  "results": [
    { "id": "ord_812", "customer": "Acme Ltd", "total": "129.00 EUR", "status": "shipped" }
  ],
  "nextCursor": "eyJwYWdlIjogMn0=",
  "truncated": true,
  "hint": "Showing 20 of 1,284 orders. Filter by status or date range, or pass nextCursor for the next page."
}
GET /premium-data HTTP/1.1
Host: api.example.com

HTTP/1.1 402 Payment Required
PAYMENT-REQUIRED: <base64 JSON: amount, asset, network, payTo, maxTimeoutSeconds>

GET /premium-data HTTP/1.1
Host: api.example.com
PAYMENT-SIGNATURE: <base64 JSON: the signed payment payload>

HTTP/1.1 200 OK
PAYMENT-RESPONSE: <base64 JSON: success, transaction, network, payer>
# Provision an anonymous sandbox with working keys, no signup
stripe sandbox create --help
{ "id": "pi_3Mtw...", "object": "payment_intent", "amount": 2000, "livemode": false }
<!-- Anonymous to an agent: no role, no name -->
<div class="btn" onclick="checkout()"><svg>...</svg></div>

<!-- Legible: native control, accessible name, labeled field -->
<label for="email">Email</label>
<input id="email" name="email" type="email">
<button type="submit">Place order</button>
<button type="button" aria-label="Remove item from cart"><svg aria-hidden="true">...</svg></button>
GET /v1/agents/acme-support-bot/memory?user=usr_481&project=refunds
{
  "scope": { "user": "usr_481", "project": "refunds" },
  "entries": [
    {
      "id": "mem_07",
      "text": "Prefers refunds to the original card, not store credit",
      "source": "conv_2291",
      "last_used": "2026-09-28",
      "expires_at": "2027-03-28",
      "actions": ["edit", "delete"]
    }
  ],
  "delete_all": "DELETE /v1/agents/acme-support-bot/memory?user=usr_481&project=refunds"
}
GET /v1/refund_cases/rc_88
-> 200 OK
ETag: "v7"

PATCH /v1/refund_cases/rc_88
If-Match: "v7"
{ "status": "approved", "amount": 4900 }

-> 412 Precondition Failed
ETag: "v8"
Content-Type: application/problem+json
{ "title": "Case changed since you read it", "current_etag": "v8", "changed_by": "human:jane", "re_read": "/v1/refund_cases/rc_88" }
{
  "message": {
    "role": "ROLE_USER",
    "messageId": "msg_552",
    "contextId": "ctx_refund_ord123",
    "referenceTaskIds": ["task_refund_01"],
    "parts": [{ "text": "Also refund the $6.90 shipping fee on the same order." }]
  }
}
POST /hooks/acme HTTP/1.1
Content-Type: application/cloudevents+json
Acme-Signature: t=1791036000,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e7...
Acme-Delivery-Attempt: 2

{
  "specversion": "1.0",
  "id": "evt_4410",
  "source": "https://api.acme.com/charges",
  "type": "com.acme.charge.refunded",
  "time": "2026-10-03T14:00:00Z",
  "data": { "charge_id": "ch_123", "amount": 4900 }
}
HTTP/1.1 200 OK
Content-Type: application/json
RateLimit-Policy: "refunds";q=100;w=60
RateLimit: "refunds";r=4;t=38

HTTP/1.1 429 Too Many Requests
RateLimit: "refunds";r=0;t=21
Retry-After: 21
POST /v1/refunds HTTP/1.1
Acme-Version: 2026-06-01

HTTP/1.1 200 OK
Acme-Version: 2026-06-01
Acme-Latest-Version: 2026-09-15
Link: <https://acme.com/docs/upgrades/2026-09-15.md>; rel="help"
GET /docs/refund-api HTTP/1.1
-> 308 Permanent Redirect
Location: /docs/refunds

POST /v1/refunds/legacy_export HTTP/1.1
-> 410 Gone
Content-Type: application/problem+json
{ "title": "Retired on 2026-07-01", "replacement": "/v1/exports?type=refunds" }
{ "jsonrpc": "2.0", "method": "notifications/cancelled",
  "params": { "requestId": "req_refund_77", "reason": "Parent task cancelled by orchestrator" } }
{
  "task": "refund_ord123",
  "status": "cancelled",
  "budget_ms": 27500,
  "completed_before_cancel": ["hold_released"],
  "not_started": ["refund_issued", "customer_emailed"]
}
[ ] Exists as an API endpoint or MCP tool
[ ] If not: documented reason why human auth is required
[ ] If human auth required: agent can continue after auth (not re-blocked)
[ ] Rate limits and scopes are equivalent to browser/app access
[ ] Error responses are machine-readable (not just HTML error pages)
1. Agent starts work (no account required)
   → Service issues ephemeral resource ID + signed claim URL
   → Agent surfaces claim URL to human: "Your project is live at https://xyz.netlify.app. Claim it here: [URL]"

2. Human clicks claim link
   → Service authenticates human (OAuth, magic link, etc.)
   → Resource transfers to human's account
   → Agent session can continue under the now-authenticated context

3. Optional: agent continues with enriched access post-claim
{
  "resource_id": "proj_xyz",
  "resource_url": "https://xyz.example.com",
  "claim_url": "https://example.com/claim?token=abc123&expires=2026-06-07T00:00:00Z",
  "expires_at": "2026-06-07T00:00:00Z",
  "scopes_post_claim": ["deploy", "config", "logs"]
}
{
  "trace_id": "abc123",
  "agent": "claude-code/1.4",
  "session_id": "sess_xyz",
  "task": "deploy_site",
  "outcome": "success",
  "context_sources_used": ["llms.txt", "netlify-mcp"],
  "context_hit_rate": 0.87,
  "time_to_first_tool_call_ms": 1240,
  "tool_calls": 3,
  "tokens_consumed": 4200,
  "feedback": "llms.txt missing blob storage docs; agent fell back to web search"
}
{
  "operations": [
    {
      "name": "rename_files",
      "goal": "Rename every file that matches a pattern, in one call",
      "args": {
        "pattern": "glob matched against file names, e.g. *.jpeg",
        "rule": "replacement applied to each matched name, e.g. s/\\.jpeg$/.jpg/"
      },
      "writes": true,
      "verify_with": "list_files",
      "returns": "count renamed, list of new names"
    },
    {
      "name": "list_files",
      "goal": "List file names under a path, filtered by a pattern",
      "args": { "pattern": "glob matched against file names" },
      "writes": false
    }
  ]
}
{
  "task_id": "t_8841",
  "status": "completed",
  "request": "Which plan covers 40 seats with SSO, and what does it cost per year?",
  "answer": "The Business plan covers 40 seats with SSO. The yearly cost is 9,600 USD or 11,520 USD, depending on which source is current.",
  "language": "en",
  "artifacts": [
    {
      "name": "plan-comparison.csv",
      "url": "https://acme.example/files/f_231",
      "media_type": "text/csv"
    }
  ],
  "unresolved": [
    {
      "question": "Price per seat per month on the Business plan",
      "sources": [
        { "url": "https://acme.example/pricing", "says": "20 USD" },
        { "url": "https://acme.example/docs/billing", "says": "24 USD" }
      ],
      "effect_on_answer": "Yearly cost is 9,600 USD or 11,520 USD"
    }
  ]
}
{
  "memory": {
    "records": {
      "store": "append_only",
      "contents": ["trajectory", "outcome"],
      "retrieval": "dense retrieval and reranking over raw records",
      "erase": "DELETE /memory/records/{id}"
    },
    "guidance": {
      "derived_from": "records",
      "built": "per task, on demand",
      "persisted": false
    },
    "preferences": {
      "file": "/memory/preferences.json",
      "retrieved": false,
      "entries": [
        { "rule": "confirm before sending email", "scope": "work" },
        { "rule": "book travel without asking under 200 USD", "scope": "personal" }
      ]
    },
    "baseline": "extracted memory ships only if it beats raw-record retrieval on our own tasks"
  }
}
{
  "rule": {
    "id": "refund-approval-2",
    "requires": "approval before execution",
    "approver_role": "payments_lead",
    "scope": { "operation": "refund.create", "region": "EU", "amount_over": "500 EUR" },
    "effective_from": "2026-10-01",
    "effective_until": null,
    "supersedes": "refund-approval-1"
  },
  "response": {
    "operation": "refund.create",
    "status": "rejected",
    "step_valid": false,
    "rules_checked": ["refund-approval-2"],
    "violation": "refund of 800 EUR in EU has no prior approval from payments_lead",
    "next": "POST /approvals with the exact operation, then retry"
  }
}