---
title: "Runtime and scopes"
description: "How agents resolve identity and retrieval boundaries at runtime."
date: "2026-11-20"
modified: "2026-11-20"
reviewed: "2026-11-20"
---

# Runtime and scopes

> How agents resolve identity and retrieval boundaries at runtime.

Published on: 2026-11-20

Last updated on: 2026-11-20

Each agent runtime call carries an agent identity plus any extra scope hints needed to narrow retrieval.

## Request shape

Use the OpenAI-compatible chat endpoint and pass the agent identity by route or header.

```http
POST /v1/chat/completions
Authorization: Bearer acm_live_...
Content-Type: application/json
X-Achiral-Agent: release-readiness-agent
X-Achiral-Project: payments
X-Achiral-Scan-Session: optional-session-id
```

The route form is `POST /v1/agents/<agent-slug>/chat/completions`. The token needs the `inference:chat` scope.

## How the runtime resolves the agent

The runtime resolves access before retrieval. It checks, in order:

1. the token, its organization and its environment;
2. that an agent with this slug exists in that environment;
3. that the agent's status is `active`;
4. that the token is bound to this agent; and
5. if `X-Achiral-Scan-Session` is set, that the session belongs to this agent and is still open.

| Failure                                                         | Status | Code                      |
| --------------------------------------------------------------- | ------ | ------------------------- |
| No agent with that slug in the token's environment              | 404    | `agent_not_found`         |
| Agent is `draft`, `paused`, `closed` or `deleted`               | 403    | `agent_not_active`        |
| Token is not bound to this agent                                | 403    | `agent_token_not_allowed` |
| Scan session is completed, canceled or belongs to another agent | 400    | `invalid_scan_session`    |

## Agent-bound tokens

Create a token with **Token** on the agent's card in **Memory > Agents**. It is bound to that one agent, has the `inference:chat` scope, and is shown once. A Test environment issues `acm_test_` tokens and Production issues `acm_live_` tokens. By default a token not bound to any agent cannot call an agent.

## Retrieval boundary

Agent retrieval is always limited to the agent's organization. Within it, the agent retrieves:

- its own memories;
- memories for its client or account; and
- memories the organization marked as methodology, only when the agent's `memory.includeOrganizationMethodology` flag is on.

Only owners and admins can turn that flag on, or `memory.includeCrossClientPatterns`. See [Who can do what](/docs/agents#who-can-do-what).

## Scope hints

Scope hints narrow retrieval. They do not grant extra access.

| Scope             | Use it for                                                          |
| ----------------- | ------------------------------------------------------------------- |
| Agent             | The agent identity for the responsibility                           |
| Client or account | The boundary attached to the agent when it is created               |
| Project           | `X-Achiral-Project`: a narrower retrieval hint inside that boundary |
| Scan session      | `X-Achiral-Scan-Session`: a run-specific narrowing hint             |

## Good write-back behavior

When you decide what should persist across runs, store the outcomes that help later work, such as:

- decisions;
- approvals;
- stable preferences;
- implementation choices; and
- handoff summaries.

Avoid treating every transient runtime detail as durable memory.

## Limits

Each agent has four limits. Any role that can edit the agent may change them, up to a ceiling that applies to everyone. A change above the ceiling is refused with `400` and code `AGENT_LIMIT_ABOVE_CEILING`, and a stored value above it is held to the ceiling.

| Limit                       | Default | Ceiling |
| --------------------------- | ------- | ------- |
| Runtime requests per minute | 60      | 120     |
| Report payload              | 1 MB    | 2 MB    |
| Memory records per report   | 100     | 200     |
| Upstream model response     | 8 MB    | 10 MB   |

A runtime request over the agent's requests-per-minute limit gets `429` with `agent_rate_limited` and `Retry-After`; the calling agent's limit is checked against four counts: the organization, the agent, the token, and the client IP address. Whichever count fills first refuses the request. All agents in an organization share the organization count, so their combined calls in a minute are held to the calling agent's limit. Calls for several agents from one IP address, such as a CI runner, share the IP count. A report over its payload limit gets `413`, as does one that would write more records than allowed. An upstream response over its limit fails with `502` and code `upstream_response_too_large`; Achiral stops reading a streamed response as soon as it passes the limit.

## Reading an agent's memory

Open the **Memory** link on the agent's detail panel, which goes to `/memory?scope=agent:<agentId>`. The creator of the agent can read it there, and so can owners and admins. Anyone else gets `Agent not found`.

## Production guidance

Start with one narrow agent and review whether the retrieved context is helping. If the scope is too broad, split the workflow or pass a narrower project hint.
