
{
  "spec": "EAS",
  "version": "0.1.0-draft",
  "domains": [
    {"domain":"EAS-01","order":1,"slug":"pattern-selection","title":"Pattern Selection","essay":"01-use-the-simplest-pattern-that-works","summary":"Every Workflow uses the lowest rung on the autonomy ladder that meets its requirements, states that rung explicitly, and justifies in writing and with evidence every climb above a fixed workflow. Rules that must be exactly right are code, never model judgement.","controls":[{"id":"EAS-01.01","title":"Declared pattern rung","level":"L1","applies":"All Workflows.","requirement":"Every Workflow MUST declare its rung on the autonomy ladder (`code`, `single_call`, `fixed_workflow`, `agent`, `multi_agent`), and the declared rung MUST match the implementation. A Workflow declared at `single_call` MUST NOT loop or let the model select Tools; a Workflow declared at `fixed_workflow` MUST have control flow fixed in code, with the model invoked only at predetermined Steps; a Workflow in which a model chooses Tools in a loop MUST be declared `agent` or higher.","rationale":"Each rung includes the costs of the ones below it and adds its own in reliability, latency, cost, testability and debuggability. The rung has to be named before those costs can be weighed, and a system that has drifted up the ladder unnoticed pays them without having chosen to.","evidence":{"declared":"`rung` is set for every Workflow in the manifest.","static":"The control flow in code matches the declared rung: no model-driven tool loop in a `single_call` or `fixed_workflow` Workflow; no sub-agents, handoffs or agent-as-tool constructs in a Workflow declared below `multi_agent`.","runtime":"For `single_call` Workflows, every Run has exactly one ModelCall span and no `execute_tool` spans. For Workflows below `multi_agent`, `eas.actor_chain` never contains more than one agent identity."},"remediation":{"scope":"local","guidance":"Add `rung` to the manifest for each Workflow. Where the declared and implemented rungs differ, either correct the declaration (and meet EAS-01.02) or simplify the implementation to the declared rung."},"components":["orchestrator"],"see_also":["EAS-01.02"],"section":"a-ladder-not-a-menu"},{"id":"EAS-01.02","title":"Written justification for agent and multi-agent rungs","level":"L1","applies":"All Workflows at rung `agent` or `multi_agent`.","requirement":"Every Workflow at rung `agent` or `multi_agent` MUST have a written justification that names the specific requirement the next rung down cannot meet. Generic benefits (\"more flexible\", \"the model might find a better path\") MUST NOT be accepted as justification. The justification SHOULD be reviewed as part of architecture review.","rationale":"Teams over-build because the agentic version is more interesting and demos better, while its costs stay invisible until production. Asking \"why not the simpler pattern?\" in writing makes those costs visible at the point of decision.","evidence":{"declared":"`rung_justification` is present and non-empty for every Workflow at rung `agent` or `multi_agent`.","attested":"What specific requirement can the lower rung not meet? A valid answer names a concrete property of the problem (for example, the number and order of lookups depends on what earlier lookups return, with too many combinations to enumerate), not a general benefit of autonomy. Who reviewed the justification?"},"remediation":{"scope":"local","guidance":"Write a short design note answering \"why not the simpler pattern?\" and record its conclusion in `rung_justification`. If no concrete requirement can be named, move the Workflow down a rung."},"see_also":["EAS-01.01","EAS-01.05"],"section":"the-test-for-climbing-a-rung"},{"id":"EAS-01.03","title":"Deterministic policy responses","level":"L1","applies":"All Workflows that use a model.","requirement":"Logic that is known and must be exactly right (eligibility rules, routing tables, compliance checks, calculations, and legally required actions such as honouring an unsubscribe) MUST be implemented in deterministic code. A model MAY interpret unstructured input into a structured result (for example a classification against a schema), but the policy response to that result MUST be selected by code, not by model judgement.","rationale":"A model that is right ninety-eight percent of the time adds an error rate to a problem that previously had none. In the reply-handling example, understanding the reply is the model's job; deciding what to do about an unsubscribe is the part that must never be wrong, so it belongs to code.","evidence":{"static":"For each business rule the Workflow applies, locate where the decision is made. Rules decided by a prompt instruction or by the model's choice of Tool, rather than by code branching on a structured model output, are findings. Routing from classification labels to handlers is a deterministic table or branch with unit tests.","attested":"Which outcomes of this Workflow are legally required or must be exactly right, and where in code is each one decided?"},"remediation":{"scope":"local","guidance":"Split the model's role into interpretation only: have it return a schema-constrained label or extraction, and move the policy response into a deterministic routing step with unit tests. Add a new label and route when a new category emerges."},"components":["orchestrator","policy-engine"],"see_also":["EAS-04.01"],"section":"a-worked-example-handling-replies"},{"id":"EAS-01.04","title":"Justified agent boundaries in multi-agent designs","level":"L2","applies":"All Workflows at rung `multi_agent`.","requirement":"Every boundary between agents in a `multi_agent` Workflow MUST be justified by at least one of: context isolation, permission separation, genuine parallelism of independent sub-problems, or independent ownership by different teams. A split that mirrors human roles (researcher, writer, manager) without one of these reasons MUST NOT be accepted as justification.","rationale":"Each hand-off between agents is a lossy compression of context, each added agent multiplies tokens and latency, and errors compound across hops. Only these four reasons repay that cost; role-play describes an org chart, not a technical requirement.","evidence":{"declared":"Every entry in `agents[]` carries a `boundary_reason` (`context_isolation`, `permission_separation`, `parallelism` or `independent_ownership`).","static":"Each sub-agent's construction shows the claimed reason: a compact return contract (context isolation), a distinct and narrower tool set or credential (permission separation), concurrent execution (parallelism), or a separately versioned component owned by another team (independent ownership).","runtime":"Every agent identity appearing in `eas.actor_chain` corresponds to a sub-agent named in the justification.","attested":"For each agent boundary, what would break or degrade if the two agents were merged?"},"remediation":{"scope":"structural","guidance":"Merge agents whose boundary has no qualifying reason into a single agent or a fixed workflow step; keep the boundaries that isolate context or separate permissions."},"components":["orchestrator"],"see_also":["EAS-01.02","EAS-06.04","EAS-07.09","EAS-08.07"],"section":"when-multiple-agents-are-justified"},{"id":"EAS-01.05","title":"Comparative evidence for climbing a rung","level":"L3","applies":"All Workflows at rung `agent` or `multi_agent`.","requirement":"Before a Workflow is placed at rung `agent` or `multi_agent`, a lower-rung version MUST be built and both versions MUST be evaluated on the same EvalSuite, comparing task success, cost and failure modes. The higher rung MUST be retained only if the comparison shows it meets a requirement the lower rung does not.","rationale":"When a team is convinced its problem needs autonomy, an experiment settles the question better than argument. The constrained version often matches the agent on quality at a fraction of the cost.","evidence":{"declared":"`evaluation.suite` and `evaluation.dataset_version` identify the suite used for the comparison.","attested":"Where is the comparison report? It shows both versions run on the same suite and dataset version, with task success, cost per Run and a breakdown of failure modes for each."},"remediation":{"scope":"structural","guidance":"Build the simpler variant (typically a fixed workflow with model steps) against the existing EvalSuite and record the comparison alongside the rung justification."},"components":["eval-platform"],"see_also":["EAS-01.02","EAS-10.04","EAS-11.04"],"section":"restraint-as-a-platform-property"}]},
    {"domain":"EAS-02","order":2,"slug":"separation","title":"Separation of Reasoning and Execution","essay":"02-separate-reasoning-from-execution","summary":"The model never calls the outside world directly. It emits structured ToolRequests; deterministic, testable code in separate layers validates them, decides whether they may proceed, and carries them out.","controls":[{"id":"EAS-02.01","title":"No direct model-to-effect path","level":"L1","applies":"All Workflows that expose Tools to the model.","requirement":"Every ToolRequest MUST pass through a blocking, deterministic interception point before any Tool code with a side effect runs. The framework MUST NOT invoke a Tool function with model-produced arguments without that interception point being able to deny the request. The interception point MUST cover every Tool, including built-in and sub-agent Tools.","rationale":"When the framework invokes functions directly with whatever arguments the model produced, every guarantee the system needs either lives in the model's reasoning or does not exist. The model may request anything; the decision to honour the request belongs to code that does not read instructions from retrieved documents.","evidence":{"static":"A `tool.before` binding (native or adapter) that can deny a ToolRequest and return a structured refusal, with coverage of every Tool registered with the model, including Tools of sub-agents. Tools passed to the framework as bare functions with no interception are findings.","runtime":"Every `execute_tool` span is preceded, within the same Step, by an `eas.policy` span for the same ToolRequest."},"remediation":{"scope":"local","guidance":"Wrap every Tool registered with the framework in a shared interceptor that implements `tool.before`, or route all Tools through a tool gateway. Verify coverage by enumerating registered Tools at startup."},"hooks":["tool.before"],"components":["tool-gateway","policy-engine"],"see_also":["EAS-04.02"],"section":"five-layers-with-distinct-responsibilities"},{"id":"EAS-02.02","title":"Typed tool contracts","level":"L1","applies":"All Tools exposed to the model.","requirement":"Every Tool MUST have an explicit contract consisting of an input schema, an output schema, the permission scopes it requires, and a limit on the size of the output it returns to the model.","rationale":"The tool layer is a set of typed capabilities; its contract is what lets the other layers validate requests, enforce permissions and bound context without trusting the model.","evidence":{"declared":"Every Tool in `tools[]` has `required_scopes` and `output_limit_tokens` set.","static":"Each Tool definition has a machine-readable input schema and a declared output type or schema; tools typed as free-form strings or untyped dictionaries on either side are findings."},"remediation":{"scope":"local","guidance":"Define input and output models for each Tool, and record scopes and output limits in the manifest next to the Tool's name."},"components":["tool-gateway"],"see_also":["EAS-05.06","EAS-03.01"],"section":"five-layers-with-distinct-responsibilities"},{"id":"EAS-02.03","title":"Argument validation in tools","level":"L2","applies":"All Tools that accept arguments from the model.","requirement":"Tools MUST validate model-supplied arguments against their input schema and business constraints and MUST NOT trust them. Entities whose identity determines what may be accessed or changed (the customer, the account, the order) MUST be resolved from the Run's authenticated context, not from values the model extracted from text.","rationale":"A customer's message can mention an order number that isn't theirs, and a model will happily pass it on. Looking up the order from the authenticated customer's identity removes that failure entirely.","evidence":{"static":"Tool implementations validate arguments before use, and resolve principal-owned entities through the Run's Credential or session context. Tools that pass a model-supplied identifier straight to a data store or external API are findings.","attested":"For each Tool that touches customer data, which arguments come from the model and how is each validated?"},"remediation":{"scope":"local","guidance":"Remove principal-identifying parameters from Tool signatures, inject them from the Run context, and add validation of the remaining arguments at the top of each Tool."},"components":["tool-gateway","identity-broker"],"see_also":["EAS-06.01","EAS-06.02"],"section":"what-it-looks-like-in-practice"},{"id":"EAS-02.04","title":"Consequential values derived, not chosen","level":"L2","applies":"All Tools with `effect_class` other than `none`.","requirement":"Values that determine the consequence of a side effect (amounts, recipients, target records) MUST be computed by deterministic code from authoritative records and business rules. The model SHOULD supply only what requires judgement (for example a reason code), as in `propose_refund(reason_code)` rather than `refund(order_id, amount)`.","rationale":"If the model picks the amount or the order, a wrong choice lands directly in the payment system. The model's contribution should be what it is good at: understanding what is being asked and why.","evidence":{"static":"Signatures of effectful Tools do not accept amounts, recipients or target identifiers as model arguments where these can be derived from records; where they are accepted, code checks them against the authoritative record before use.","attested":"For each effectful Tool, which consequential values does the model choose, and why can they not be derived?"},"remediation":{"scope":"local","guidance":"Replace direct-effect Tools with proposal Tools that take a reason or intent from the model and compute targets and amounts in code."},"components":["tool-gateway","action-ledger"],"see_also":["EAS-02.03","EAS-03.02"],"section":"what-it-looks-like-in-practice"},{"id":"EAS-02.05","title":"No inline effects in orchestration control logic","level":"L2","applies":"All Workflows that perform side effects.","requirement":"The orchestration layer MUST NOT perform business side effects inline in its control logic (graph nodes, routing functions, workflow code that also decides ordering). Side effects MUST be performed by the execution layer.","rationale":"Effects mixed into control flow make retries and replays dangerous, because re-running the control logic re-runs the effect.","evidence":{"static":"Orchestration code (nodes, edges, routers, workflow definitions) contains no calls to payment, messaging, record-update or other effectful clients; such calls appear only in executor or Tool code behind the interception point."},"remediation":{"scope":"structural","guidance":"Move effectful calls out of control logic into Tools or executor activities, and have orchestration emit ActionIntents instead."},"components":["orchestrator","executor"],"see_also":["EAS-09.01","EAS-03.05"],"section":"five-layers-with-distinct-responsibilities"},{"id":"EAS-02.06","title":"Validated state writes","level":"L2","applies":"All Workflows with durable state.","requirement":"Model output MUST NOT mutate durable Run state without schema validation. Every write of model-derived data to state MUST be checked against a schema, and only fields the schema permits MAY be updated.","rationale":"State that the model can overwrite arbitrarily is state an injection can corrupt.","evidence":{"static":"State has a declared schema; reducers or update functions validate model-derived values before persisting, and the model cannot write arbitrary keys.","runtime":"Checkpoints that fail validation are rejected, and the rejection is visible in telemetry."},"remediation":{"scope":"local","guidance":"Define a typed state schema and validate model output in a `state.checkpoint` hook before the Step boundary is persisted."},"hooks":["state.checkpoint"],"components":["state-store","orchestrator"],"see_also":["EAS-09.03"],"section":"five-layers-with-distinct-responsibilities"},{"id":"EAS-02.07","title":"Layer-wise testability","level":"L2","applies":"All Workflows.","requirement":"Each layer MUST be tested on its own terms: Tools MUST have unit tests; orchestration MUST be tested by replaying recorded model outputs through it, deterministically and without live ModelCalls; execution MUST be tested for idempotency and policy enforcement with no model involved. Model behaviour SHOULD be tested statistically with an EvalSuite.","rationale":"Separating the layers turns one untestable end-to-end system into four testable ones and one measurable one.","evidence":{"declared":"`evaluation.suite` is set for the Workflow.","static":"The test suite contains: unit tests for each Tool; orchestration tests driven by recorded or stubbed model outputs; executor tests asserting that a repeated ActionIntent produces one effect and that policy-denied intents are not executed. Tests run in CI without model credentials, except the EvalSuite."},"remediation":{"scope":"local","guidance":"Record model outputs from representative Runs as fixtures, replay them through the orchestration in CI, and add idempotency and policy tests for the executor."},"components":["eval-platform","executor"],"see_also":["EAS-09.06","EAS-10.04"],"section":"why-the-boundaries-matter"}]},
    {"domain":"EAS-03","order":3,"slug":"actions","title":"Actions as Data","essay":"03-actions-are-data-before-they-are-effects","summary":"The model produces decisions about effects, not effects. Each side effect is committed as a durable ActionIntent with a semantic idempotency key, and a separate executor turns committed intents into effects exactly once.","controls":[{"id":"EAS-03.01","title":"Effect classification of every Tool","level":"L1","applies":"All Tools exposed to the model.","requirement":"Every Tool MUST be classified by `effect_class`: `none`, `reversible`, `reversible_delayed` or `irreversible`. A Tool whose effect cannot be undone once it happens (an email delivered, a public post, an external money transfer) MUST be classified `irreversible`, or `reversible_delayed` only if a cancellation window is actually implemented.","rationale":"Not every action is equally dangerous, and the architecture should reflect that: reversible actions can be compensated, delayed ones cancelled, and irreversible ones can only be guarded before they happen.","evidence":{"declared":"`tools[].effect_class` is set for every Tool in the manifest.","static":"Classifications match the Tool's implementation: any Tool that sends, publishes or moves money externally is `irreversible` unless it enqueues into a cancellable delay.","runtime":"Every `execute_tool` span carries `eas.tool.effect_class`, matching the manifest."},"remediation":{"scope":"local","guidance":"Add `effect_class` to each Tool in the manifest and emit it as a span attribute from the tool interception point."},"hooks":["tool.before"],"components":["tool-gateway"],"see_also":["EAS-03.08","EAS-07.04"],"section":"reversible-and-irreversible-actions"},{"id":"EAS-03.02","title":"Action ledger","level":"L2","applies":"All Workflows with Tools whose `effect_class` is not `none`.","requirement":"Every side effect MUST be committed as an ActionIntent to a durable action ledger before it is executed. The ledger MUST record, for each intent, the Run, the Principal it acts for, the action description, its lifecycle state and timestamps, and the external system's result.","rationale":"Once actions are data before they are effects, auditing becomes a query rather than a forensic investigation, and approval, dry runs, policy and pacing all gain a natural home.","evidence":{"static":"Effectful Tools do not call external systems; they (or a `tool.before` substitution) write an ActionIntent to the ledger and return. The ledger schema includes the fields above.","runtime":"Every `eas.execute` span is linked to an `eas.intent` span with the same `eas.intent.id` that precedes it. No `execute_tool` span with `eas.tool.effect_class` other than `none` performs an effect without a corresponding `eas.intent` span.","attested":"How would you answer \"how many people received the wrong email?\" after an incident, and how long would it take?"},"remediation":{"scope":"structural","guidance":"Introduce a ledger table (partitioned by tenant) and convert effectful Tools into proposal Tools that write intents; use `tool.before` substitution where Tools cannot be rewritten."},"hooks":["tool.before"],"components":["action-ledger"],"see_also":["EAS-02.04","EAS-03.05"],"section":"separate-deciding-from-doing"},{"id":"EAS-03.03","title":"Semantic idempotency keys","level":"L2","applies":"All ActionIntents.","requirement":"Every ActionIntent MUST carry an idempotency key derived from its logical purpose: tenant, Run, action type, target and position in the sequence. The key MUST NOT be derived from model-generated content (body, wording, subject). The ledger MUST reject a second intent with an existing key.","rationale":"A retry that goes back through the model can produce a different draft, recipient or amount. A content-derived key then sees two distinct actions and performs both; a key based on what the action is for does not.","evidence":{"static":"The key derivation function takes only identity and position fields, never generated text or a hash of it; the ledger has a uniqueness constraint on the key.","runtime":"No two `eas.intent` spans that reached state `executed` share an `eas.intent.key_hash` within a tenant."},"remediation":{"scope":"local","guidance":"Compute keys from (tenant, run_id, action_type, target, sequence position) and add a unique index on the key in the ledger."},"components":["action-ledger"],"see_also":["EAS-09.11"],"section":"the-twist-a-retry-can-produce-a-different-action"},{"id":"EAS-03.04","title":"Atomic intent commit with checkpoint","level":"L2","applies":"All Workflows with an action ledger and durable state.","requirement":"The write of an ActionIntent to the ledger MUST occur in the same transaction as the Checkpoint that records the Run's progress past the Decision that produced it, so that either both are durable or neither is.","rationale":"Making the decision and the record of the decision atomic means a resumed Run continues after the decision rather than re-making it, and no committed intent exists for a decision the Run has forgotten.","evidence":{"static":"Ledger and checkpoint writes share one transaction (same database transaction, or a transactional outbox written with the checkpoint). Two independent writes are a finding.","attested":"What happens if the process crashes between recording the Decision and writing the intent?"},"remediation":{"scope":"structural","guidance":"Store intents alongside checkpoints in the same transactional store, or write them to an outbox table within the checkpoint transaction."},"hooks":["state.checkpoint"],"components":["action-ledger","state-store"],"see_also":["EAS-09.03","EAS-09.05"],"section":"separate-deciding-from-doing"},{"id":"EAS-03.05","title":"Separate executor recording external reference","level":"L2","applies":"All Workflows with an action ledger.","requirement":"ActionIntents MUST be performed by an executor separate from the reasoning and orchestration layers, which reads committed intents from the ledger, performs them, records the external system's identifier for the result (`external_ref`), and marks the intent complete.","rationale":"A separate, boring, reliable component turning decisions into effects is what lets a nondeterministic one take real actions without the system becoming nondeterministic about what it did.","evidence":{"static":"The executor is a distinct component (process, worker or activity) that selects intents by state from the ledger; orchestration code does not call effectful clients.","runtime":"Every `eas.execute` span ending with `eas.intent.state = executed` has `eas.intent.external_ref_present = true`."},"remediation":{"scope":"structural","guidance":"Move effectful client calls into an executor that polls or subscribes to the ledger, and persist the target system's identifier on success."},"components":["executor","action-ledger"],"see_also":["EAS-02.05"],"section":"separate-deciding-from-doing"},{"id":"EAS-03.06","title":"Exactly-once at the far end","level":"L2","applies":"All Tools whose `effect_class` is not `none`.","requirement":"The executor MUST ensure each ActionIntent produces at most one effect by: passing the ledger's key to targets that accept idempotency keys; using upserts keyed on an identifier the system controls; or, for targets offering neither, taking a lease on the intent before acting and reconciling against the target system's records before retrying any intent whose outcome is uncertain. For targets without native idempotency, the remaining uncertainty window and how it is closed MUST be documented.","rationale":"The ledger stops the system intending an action twice, but the executor can crash too. Where the target offers no deduplication, a narrow window remains; pretending it doesn't exist is how duplicates happen.","evidence":{"declared":"`tools[].idempotency` is set (`native_key`, `upsert` or `none`) for every effectful Tool.","static":"For `native_key`, the ledger key is passed on each request. For `upsert`, the write is keyed on a system-controlled identifier. For `none`, a lease on the intent precedes the call, the request is tagged with the intent's identifier, and a reconciliation step queries the target before any retry of an intent in `executing` state.","runtime":"No two `eas.execute` spans with state `executed` share an `eas.intent.id`.","attested":"For each effectful Tool with `idempotency = none`, where is the uncertainty window documented and how is it closed?"},"remediation":{"scope":"local","guidance":"Pass keys through where supported; elsewhere add leasing, tag outbound requests with the intent ID, and reconcile from provider events before retry."},"components":["executor","action-ledger"],"see_also":["EAS-05.08"],"section":"idempotency-at-the-far-end"},{"id":"EAS-03.07","title":"Approval as a ledger state transition","level":"L2","applies":"All Tools whose `approval` is `human`.","requirement":"An action requiring human approval MUST be committed to the ledger in state `proposed`, and the executor MUST NOT perform it until it has transitioned to `approved`. Approval MUST NOT be implemented as an in-process wait that holds the Run's worker.","rationale":"With actions as data, approval is just another step in the action's lifecycle; no separate mechanism is bolted on beside the agent, and batching approvals is a query over proposed actions.","evidence":{"declared":"`tools[].approval` is set for every effectful Tool.","static":"The executor selects only intents in `approved` state; the approval interface updates ledger state rather than resuming a blocked call.","runtime":"Every `eas.execute` span for an intent with `eas.intent.approval = human` is preceded by an `eas.intent` span for the same intent in state `approved`."},"remediation":{"scope":"structural","guidance":"Replace blocking approval prompts with intents committed as `proposed` and an approval service that moves them to `approved` or `rejected`."},"components":["approval-service","action-ledger","executor"],"see_also":["EAS-09.02"],"section":"the-things-this-makes-possible"},{"id":"EAS-03.08","title":"Irreversible last, behind a gate","level":"L2","applies":"Workflows that perform more than one effect, or any `irreversible` effect.","requirement":"In a multi-step Workflow, reversible effects MUST be ordered before irreversible ones, and every irreversible effect MUST be preceded by a gate: a policy check and, for high-stakes cases, human approval. Reversible effects MUST be recorded with a compensating action, and compensations MUST themselves be executed through the ledger. The design MUST NOT claim compensation for an irreversible effect.","rationale":"If anything fails before the gate, everything can be undone; the gate is the last point at which a mistake can be caught. Compensations routed through the ledger mean a crash during rollback resumes the rollback.","evidence":{"declared":"Every Tool with `effect_class = irreversible` has `approval` set to `policy` or `human`.","static":"Workflow ordering places irreversible Tools after reversible ones; reversible intents carry a `compensation`; compensating actions are written as ActionIntents; no compensation is defined for irreversible Tools.","runtime":"Within a Run, no `execute_tool` span with `eas.tool.effect_class = reversible` follows one with `eas.tool.effect_class = irreversible`; every `irreversible` effect is preceded by an `eas.policy` span with decision `allow` or an approved human intent."},"remediation":{"scope":"structural","guidance":"Reorder the Workflow so irreversible steps come last; add compensations for reversible steps as ledger intents; consider `reversible_delayed` (a cancellation window) where a short delay is acceptable."},"components":["action-ledger","policy-engine","approval-service","executor"],"see_also":["EAS-03.01","EAS-03.07","EAS-04.02"],"section":"reversible-and-irreversible-actions"},{"id":"EAS-03.09","title":"Effect pacing in the executor","level":"L2","applies":"Workflows whose effects are subject to external rate expectations (for example outbound messaging).","requirement":"Rate limits on real-world effects (for example messages per hour per sending account or per tenant) MUST be enforced in the executor, independent of how fast the agent reasons.","rationale":"Pacing sits naturally in the executor, where it governs what actually happens in the world rather than how quickly decisions are made.","evidence":{"static":"Rate limiters keyed by account or tenant in the executor, configured per action type.","runtime":"The count of `eas.execute` spans per account and action type per hour never exceeds the configured rate."},"remediation":{"scope":"local","guidance":"Add a keyed rate limiter in the executor that defers intents rather than dropping them."},"components":["executor"],"see_also":["EAS-05.07"],"section":"the-things-this-makes-possible"},{"id":"EAS-03.10","title":"Dry-run mode","level":"L3","applies":"All Workflows with an action ledger.","requirement":"It MUST be possible to run a Workflow with the executor disabled, so that ActionIntents are committed to the ledger and can be inspected but no effects are performed.","rationale":"With actions as data, dry runs become trivial: disable the executor, run the agent, and see exactly what it would have done.","evidence":{"static":"A configuration switch disables execution per Workflow, version or Run without code change.","runtime":"Dry-run Runs produce `eas.intent` spans and no `eas.execute` spans.","attested":"How is a dry run started, and how are its intents reviewed and discarded?"},"remediation":{"scope":"local","guidance":"Add a per-Run flag that the executor honours by skipping intents from that Run, and a ledger view for reviewing them."},"components":["executor","action-ledger"],"see_also":["EAS-10.09"],"section":"the-things-this-makes-possible"}]},
    {"domain":"EAS-04","order":4,"slug":"enforcement","title":"Enforcement Outside the Model","essay":"04-enforce-outside-the-model","summary":"A prompt expresses intent; it is not a control. Every rule that matters is enforced by deterministic, version-controlled, tested policy at points the model's output must pass through, and as close to the protected resource as possible, so that the system is indifferent to whether the model was persuaded.","controls":[{"id":"EAS-04.01","title":"Prompt rules have code backstops","level":"L1","applies":"All Workflows.","requirement":"Every rule concerning privacy, money, legal obligations or safety that is stated to the model (in a system prompt, Tool description, or other instruction placed in context) MUST also be enforced by a deterministic check outside the model — at the policy gate, an output check, the data layer or the network — that blocks or escalates a violating ToolRequest or output regardless of what the model proposed. The rule MAY remain in the prompt; the prompt MUST NOT be its only enforcement point.","rationale":"A rule in a prompt is followed statistically, can be argued with by injected text, and can be weakened by an unrelated prompt edit. At production volume a 99.5% compliance rate is an incident rate, so the rule must also exist somewhere the model cannot argue with.","evidence":{"declared":"Each such rule appears in `policies[]` with an `enforced_at` that includes at least one of `gateway`, `output`, `data_layer` or `network`. A policy whose `enforced_at` is only `prompt` and whose subject is privacy, money, legal obligation or safety is a finding.","static":"Procedure. (1) Collect every instruction text the model receives: system prompts and templates, Tool descriptions and parameter descriptions, sub-agent instructions, and any policy text injected as context. (2) Extract every prohibition, limit or obligation (\"never\", \"do not\", \"only\", \"always\", \"must\", numeric caps, permitted recipients or targets, required disclaimers). (3) Classify each as privacy, money, legal, safety, or other. (4) For each, locate the deterministic code that enforces it — a check in the tool interception point, an outbound content check, a data-layer permission, a network rule — and record the file and rule identifier. (5) Every rule in the privacy, money, legal or safety categories with no matching enforcement is a finding; a match that only logs, or that relies on a model or classifier to decide, does not count. Rules in the \"other\" category are reported but not findings.","runtime":"For each declared policy, `eas.policy` spans carrying its rule identifier in `eas.policy.rule_id` occur on Runs that invoke the Tools or produce the outputs it governs.","attested":"For a sample of rules stated in the prompt (for example a refund limit or a permitted-recipient rule): if the model ignored this instruction, what code would stop the action, and where is its test?"},"remediation":{"scope":"local","guidance":"For each unmatched rule, add a check over the structured ToolRequest in the `tool.before` hook (argument bounds, permitted targets) or over the outbound content before it is sent, and record it in `policies[]` with its code and test references. Keep the sentence in the prompt."},"hooks":["tool.before"],"components":["policy-engine","tool-gateway"],"see_also":["EAS-04.02","EAS-04.03","EAS-01.03"],"section":"why-prompts-are-not-controls"},{"id":"EAS-04.02","title":"Policy gate on every ToolRequest","level":"L1","applies":"All Workflows that expose Tools to the model.","requirement":"Every ToolRequest, from every agent and sub-agent in the Run, MUST be evaluated by a deterministic policy gate before any effect. The gate MUST check at least that the Tool is allowed for the Workflow; that the Run's Credential carries the Tool's required scopes; that arguments are within policy bounds (amounts, permitted recipients or targets, territory); whether the Run is tainted and the Tool is restricted after untrusted exposure; and that the action is within the tenant's rate and spend limits. The gate MUST be able to deny and return a structured refusal to the model, and MUST fail closed.","rationale":"The boundary between reasoning and execution is the natural enforcement point. Because a ToolRequest is structured data rather than prose, the checks are ordinary deterministic code, and they are the control that still holds after every other defence has been bypassed.","evidence":{"declared":"`tools[].required_scopes` and `tools[].approval` are set for every Tool; `policies[]` entries with `enforced_at: gateway` cover argument bounds for consequential Tools.","static":"A blocking `tool.before` hook or tool gateway through which every Tool is invoked, including built-in, hosted and sub-agent Tools; a Tool reachable by a path that bypasses it is a finding. The gate implements each of the five checks above, takes identity and taint from the Run rather than from arguments, and denies on error or timeout.","runtime":"Every `execute_tool` span is preceded, within the same Step, by an `eas.policy` span with `eas.policy.point = gateway` for that ToolRequest; no `execute_tool` span follows an `eas.policy` span whose decision is `deny`."},"remediation":{"scope":"local","guidance":"Route every Tool through a single wrapper or gateway that evaluates policy before invocation; derive the allowed-tool list, scopes and bounds from the manifest; convert exceptions in the gate to `deny`."},"hooks":["tool.before"],"components":["tool-gateway","policy-engine"],"see_also":["EAS-02.01","EAS-06.03","EAS-07.03","EAS-05.05","EAS-04.05"],"section":"guardrails-as-policy"},{"id":"EAS-04.03","title":"Deterministic output checks","level":"L2","applies":"Workflows that send, publish or hand over model-drafted content to people or external systems.","requirement":"Before model-drafted content leaves the system, deterministic checks MUST verify every property that can be decided mechanically for that Workflow, including at least: conformance to the expected schema; presence of required disclosures; absence of personal data that should not be present; and, where the content makes factual claims or citations, that each maps to a source in the Run's context. Properties that cannot be checked mechanically (tone, appropriateness) MAY be screened by a classifier or second model, but its result MUST only allow or escalate for review, never serve as the sole guarantee for a property a deterministic check could decide.","rationale":"The same reasoning that applies to ToolRequests applies to outputs: where a check can be made mechanically it should be, and a probabilistic screen is a signal that triggers review, not a guarantee.","evidence":{"declared":"`policies[]` entries with `enforced_at: output` for each required disclosure, PII rule and schema.","static":"An outbound check on every egress path for drafted content (send, publish, post Tools and user-facing responses), implemented in code: schema validation, required-text checks, PII detection with a deterministic block or redaction, and claim-to-source mapping where applicable. Any classifier result is wired only to `allow` or `escalate`.","runtime":"Every `execute_tool` span with `eas.tool.egress = true` that carries drafted content is preceded by an `eas.policy` span with `eas.policy.point = output`."},"remediation":{"scope":"local","guidance":"Add an output-check stage in front of every send or publish Tool that runs the mechanical checks first and routes uncertain classifier results to review."},"hooks":["tool.before"],"components":["policy-engine","approval-service"],"see_also":["EAS-04.01","EAS-12.02"],"section":"guardrails-as-policy"},{"id":"EAS-04.04","title":"Policy as code","level":"L2","applies":"All Workflows.","requirement":"Policies MUST be kept in version control, changed only through review by someone who understands the business rule and its failure modes, and deployed through the same pipeline as other code with the ability to roll back. Each policy MUST have unit tests, runnable without a model, containing cases it must allow and cases it must block, including adversarial cases from red-team exercises and past incidents.","rationale":"Guardrails are critical code and deserve the same discipline. Policy tests guarantee that wrong proposals cannot become wrong actions without an expensive, nondeterministic evaluation.","evidence":{"declared":"`policies[].code_ref` and `policies[].tests_ref` set for every policy.","static":"Policy source lives in the repository (not only in a console or database); required review on the policy paths; tests for each policy with both must-allow and must-block cases, at least some traceable to incidents or red-team findings; tests run in CI without model calls; the policy deploy has a rollback path.","attested":"Who reviews a change to a policy, and how was the last policy change rolled out and how would it be rolled back?"},"remediation":{"scope":"local","guidance":"Move rules out of prompts, consoles and ad-hoc configuration into a policy module or policy-language bundle in the repository; add a test file per policy with allow and block tables; add each incident's triggering request as a block case."},"components":["policy-engine","release-control"],"see_also":["EAS-10.01","EAS-02.07"],"section":"policy-is-code-treat-it-that-way"},{"id":"EAS-04.05","title":"Decision logging with rule id","level":"L2","applies":"All Workflows.","requirement":"Every PolicyDecision MUST be recorded with its outcome (`allow`, `deny`, `escalate`), the identifier of the rule that produced it, the enforcement point, and the Run and ToolRequest or output it concerns.","rationale":"Controls are auditable when every decision is logged with the rule that produced it; a rejection that is logged lets a person see both the attempt and the reason.","evidence":{"static":"The policy gate and output checks emit a structured record for every decision, not only for denials.","runtime":"Every `eas.policy` span carries non-empty `eas.policy.decision`, `eas.policy.rule_id` and `eas.policy.point`."},"remediation":{"scope":"local","guidance":"Return a rule identifier from every policy evaluation and emit it on an `eas.policy` span alongside the decision."},"hooks":["tool.before"],"components":["policy-engine","telemetry-pipeline"],"see_also":["EAS-06.10","EAS-07.10"],"section":"guardrails-as-policy"},{"id":"EAS-04.06","title":"Lowest-layer enforcement","level":"L3","applies":"Workflows with `data_access` of `private` or `regulated`, or with egress-capable Tools.","requirement":"Rules that protect data visibility, tenant isolation and exfiltration MUST be enforced at the lowest layer able to enforce them — the data layer (for example row-level security on the delegated identity), the network (egress control), or cloud identity policy (access scoped to one tenant's resources) — in addition to wherever the application expresses them. An application-layer filter in a Tool MUST NOT be the only enforcement of such a rule.","rationale":"The application layer expresses policy and the data layer enforces it. Enforcement close to the resource turns a forgotten filter or a tricked Tool into a denied query and an alert rather than a breach.","evidence":{"declared":"`policies[]` entries for data visibility, tenant isolation and egress have `enforced_at` including `data_layer` or `network`.","static":"Data stores apply row- or column-level policy keyed on the Run's delegated identity, or are physically partitioned per tenant; runtime egress is restricted at the network layer; cloud credentials used by the Run are scoped to the tenant's resources.","runtime":"`eas.policy` spans with `eas.policy.point = data_layer` or `network` appear for denied cross-tenant or off-allowlist requests.","attested":"If a Tool omitted its permission filter, what would the data store return?"},"remediation":{"scope":"structural","guidance":"Pass the delegated identity to data stores and enable their native row-level security or per-tenant partitioning; place the runtime behind an egress proxy; narrow cloud credentials per Run."},"components":["data-governance","egress-proxy","identity-broker"],"see_also":["EAS-06.11","EAS-06.12","EAS-07.05"],"section":"enforcement-belongs-as-low-in-the-stack-as-possible"}]},
    {"domain":"EAS-05","order":5,"slug":"bounds","title":"Bounds","essay":"05-bound-everything","summary":"Every dimension along which an agent can consume resources has an explicit limit, enforced by deterministic code outside the model, so that the worst case of any Run can be stated in advance.","controls":[{"id":"EAS-05.01","title":"Step limit","level":"L1","applies":"All Workflows at rung `agent` or `multi_agent`.","requirement":"Every Run MUST have a maximum number of Steps, enforced by the orchestration layer. Reaching the limit MUST end the Run with a distinct terminal status (`budget_exhausted`), not an error that triggers a retry.","rationale":"A confused model can loop indefinitely. At production volume a loop is a statistical certainty, and the only reliable defence is a hard cap the model cannot negotiate with.","evidence":{"declared":"`budgets.steps` is set for the Workflow in the manifest.","static":"The framework's step or recursion limit is set explicitly to a finite value, in code or configuration that the model cannot influence. A framework default counts only if the profile confirms it is finite.","runtime":"Every Run span carries `eas.budget.steps.limit`; no Run's step count exceeds it; Runs that hit it end with status `budget_exhausted`."},"remediation":{"scope":"local","guidance":"Set the framework's step or recursion limit from the Workflow's declared budget, and map the limit-reached exception to a terminal status rather than a retryable error."},"hooks":["model.before","run.end"],"components":["orchestrator"],"section":"the-dimensions-that-need-limits"},{"id":"EAS-05.02","title":"Token limit","level":"L1","applies":"All Workflows.","requirement":"Every Run MUST have a cap on total input plus output tokens, checked before each ModelCall against the tokens already consumed.","rationale":"A Run with few Steps but very large context can cost as much as one with many Steps; a step cap alone does not bound spend.","evidence":{"declared":"`budgets.tokens` is set in the manifest.","static":"A check of accumulated usage against a limit runs before each model call (a `model.before` hook or equivalent). Per-call `max_tokens` alone does not satisfy this control; it bounds one call, not the Run.","runtime":"`eas.budget.tokens.used` never exceeds `eas.budget.tokens.limit` on any Run."},"remediation":{"scope":"local","guidance":"Accumulate `gen_ai.usage.*` per Run in a `model.after` hook and refuse further calls in `model.before` once the limit is reached."},"hooks":["model.before","model.after"],"components":["orchestrator","model-gateway"],"section":"the-dimensions-that-need-limits"},{"id":"EAS-05.03","title":"Wall-time limit and call timeouts","level":"L1","applies":"All Workflows.","requirement":"Every Run MUST have a maximum elapsed active time, and every ModelCall and tool invocation MUST have a timeout. Time spent durably waiting (see EAS-09.02) does not count against the active-time limit.","rationale":"A stuck tool or a slow provider should release resources and report, not hang.","evidence":{"declared":"`budgets.wall_time_s` is set in the manifest.","static":"Explicit timeouts on model clients and on every tool's outbound I/O; a Run-level deadline enforced by the orchestrator or runtime.","runtime":"No `execute_tool` or model span exceeds its configured timeout."},"remediation":{"scope":"local","guidance":"Pass explicit timeouts to the model client and to HTTP or database clients inside tools; wrap Run execution in a deadline."},"hooks":["run.start","tool.before"],"components":["orchestrator","tool-gateway","model-gateway"],"section":"the-dimensions-that-need-limits"},{"id":"EAS-05.04","title":"Cost limit","level":"L2","applies":"All Workflows.","requirement":"Every Run MUST have a cap expressed in currency that combines token consumption across models at their respective prices with metered tool and infrastructure costs.","rationale":"The currency cap catches what the token cap misses, such as an unexpected escalation to a more expensive model.","evidence":{"declared":"`budgets.cost_usd` is set in the manifest.","static":"A price table per model and a per-Run cost accumulator checked before each ModelCall.","runtime":"`eas.cost.usd` is recorded on every model span; Run totals never exceed the limit."},"remediation":{"scope":"local","guidance":"Extend the token accumulator with a per-model price table and enforce the currency cap in the same hook."},"hooks":["model.before","model.after"],"components":["model-gateway"],"see_also":["EAS-05.02","EAS-11.02"],"section":"the-dimensions-that-need-limits"},{"id":"EAS-05.05","title":"Per-tool call limit","level":"L1","applies":"All Workflows that expose tools to the model.","requirement":"Every Run MUST cap the number of invocations of each Tool, enforced at the tool interception point.","rationale":"A common failure is the model calling the same search or lookup repeatedly with minor variations, hoping for a different result.","evidence":{"declared":"`budgets.tool_calls` (default and per-tool overrides) in the manifest.","static":"A per-tool counter checked in a `tool.before` hook or tool gateway.","runtime":"No Run has more `execute_tool` spans for a Tool than its configured limit."},"remediation":{"scope":"local","guidance":"Add a per-Run, per-Tool counter to the tool interception point and deny with a structured error once exceeded."},"hooks":["tool.before"],"components":["tool-gateway"],"section":"the-dimensions-that-need-limits"},{"id":"EAS-05.06","title":"Tool output size limit","level":"L1","applies":"All Tools whose output is returned to the model.","requirement":"Every Tool MUST declare a maximum output size measured in tokens, and the limit MUST be enforced before the output enters the model's context. Truncation semantics are specified by EAS-08.01.","rationale":"An unbounded tool can flood the context window in one call, degrading reasoning and multiplying the cost of every later Step.","evidence":{"declared":"`tools[].output_limit_tokens` for every Tool in the manifest.","static":"Output size enforcement in each tool or in a shared `tool.after` hook.","runtime":"`eas.tool.output_tokens` never exceeds the Tool's declared limit."},"remediation":{"scope":"local","guidance":"Enforce limits once in a shared `tool.after` hook rather than in every tool."},"hooks":["tool.after"],"components":["tool-gateway"],"see_also":["EAS-08.01"],"section":"the-dimensions-that-need-limits"},{"id":"EAS-05.07","title":"Concurrency limits","level":"L2","applies":"Workflows that fan out (parallel tool calls, parallel sub-agents) or run multi-tenant.","requirement":"The number of parallel operations in flight MUST be capped per Run, per tenant and per Workflow, so that fan-out cannot overwhelm the systems behind the Tools.","rationale":"Agents are a different kind of client from people: one Run can fan out across hundreds of entities, at any hour, across every tenant at once.","evidence":{"declared":"`budgets.concurrency` in the manifest.","static":"Semaphores or worker-pool limits around parallel tool and sub-agent execution; tenant-level limits in the scheduler.","runtime":"Concurrent `execute_tool` spans per Run and per tenant never exceed configured limits."},"remediation":{"scope":"local","guidance":"Bound parallel execution with a semaphore sized from the manifest; add tenant-level limits at admission."},"components":["scheduler","tool-gateway"],"section":"the-dimensions-that-need-limits"},{"id":"EAS-05.08","title":"Retry in exactly one layer","level":"L1","applies":"All Workflows.","requirement":"For each dependency (model provider, tool backend), retries MUST happen in exactly one layer of the stack, using exponential backoff with jitter and honouring any retry-after signal. All other layers MUST NOT retry that dependency.","rationale":"If each of three layers retries three times, one logical call becomes twenty-seven attempts, arriving exactly when the provider is overloaded.","evidence":{"static":"Inventory every retry mechanism on the path to each dependency: model SDK client defaults, framework step retry, tool wrappers (for example decorator-based retry libraries), workflow-engine retry policies. More than one active layer for the same dependency is a finding. SDK client defaults count as an active layer unless explicitly disabled.","runtime":"For a single logical call, retry attempts appear at only one span level."},"remediation":{"scope":"local","guidance":"Choose the owning layer (typically the model gateway or the SDK client), set the others' retry counts to zero explicitly, and document the choice next to the configuration."},"components":["model-gateway"],"see_also":["EAS-05.09"],"section":"how-overload-becomes-an-outage"},{"id":"EAS-05.09","title":"Retry budgets and circuit breakers","level":"L2","applies":"All Workflows.","requirement":"Each client MUST have a retry budget limiting retries to a fixed fraction of its normal traffic, and MUST fail fast once the budget is spent. Each dependency MUST be protected by a circuit breaker.","rationale":"Retry budgets are the limit that most directly separates a bad hour from an outage.","evidence":{"static":"A retry budget (token bucket or ratio) and circuit breaker configuration for each model provider and tool backend.","runtime":"Retry rate stays below the configured fraction during provider error spikes; breaker state transitions are visible in telemetry."},"remediation":{"scope":"structural","guidance":"Centralise model access behind a gateway that owns retries, budgets and breakers for all Workflows."},"components":["model-gateway"],"see_also":["EAS-05.08"],"section":"how-overload-becomes-an-outage"},{"id":"EAS-05.10","title":"Loop detection","level":"L2","applies":"All Workflows at rung `agent` or `multi_agent`.","requirement":"The orchestration layer MUST detect repeated identical tool calls (same Tool, same normalised arguments) and repeating Step cycles, and MUST end such Runs early with status `stuck` and an escalation, rather than letting them consume their full budget.","rationale":"A stuck Run that ends quickly and tells a person is much better than one that silently burns its limit and fails.","evidence":{"static":"Normalised-argument fingerprinting of tool calls and a repetition threshold in the orchestrator or a `tool.before` hook.","runtime":"Runs with repeated identical calls end with `eas.run.status = stuck`."},"remediation":{"scope":"local","guidance":"Fingerprint each ToolRequest (tool name + canonicalised arguments) per Run and stop at a small repeat threshold."},"hooks":["tool.before"],"components":["orchestrator"],"section":"loops-are-a-normal-failure-not-an-exotic-one"},{"id":"EAS-05.11","title":"Token-based hierarchical quotas","level":"L3","applies":"Platforms where several Workflows or tenants share model capacity.","requirement":"All ModelCalls MUST pass through a gateway that enforces quotas measured in tokens, allocated hierarchically (organisation, product, tenant, Run) with guaranteed floors, borrowing, and priority classes that let interactive work take precedence over background work.","rationale":"Model throughput is the scarce shared resource; it cannot be autoscaled and must be scheduled.","evidence":{"static":"Model clients point at a gateway rather than directly at providers; quota configuration exists with hierarchy and priorities.","runtime":"Every model span carries tenant and priority attributes; quota rejections are observable.","attested":"How is model capacity allocated between products and tenants, and what happens when a tenant exceeds its share?"},"remediation":{"scope":"structural","guidance":"Introduce a model gateway with token-denominated hierarchical quotas; route all model traffic through it."},"components":["model-gateway"],"section":"model-capacity-is-a-shared-scarce-resource"},{"id":"EAS-05.12","title":"Queue-based admission","level":"L3","applies":"Platforms running Workflows at volume.","requirement":"Runs MUST be admitted through a durable queue from which workers pull according to available capacity. When capacity is exhausted, work MUST wait rather than fail; low-priority work MAY be refused at admission with a clear status.","rationale":"Refusing work at admission is far better than accepting work that will time out.","evidence":{"static":"Run creation enqueues durably; workers pull; admission control exists with priority-aware shedding.","runtime":"Queue wait time is recorded; refusals carry an explicit status."},"remediation":{"scope":"structural","guidance":"Move Run execution behind a durable queue with capacity-aware workers; route non-urgent work to provider batch interfaces."},"components":["scheduler"],"section":"model-capacity-is-a-shared-scarce-resource"},{"id":"EAS-05.13","title":"Spend as an alarm","level":"L2","applies":"All Workflows in production.","requirement":"Spend per Workflow and per tenant MUST be tracked against a baseline, and exceeding a configured multiple of that baseline MUST page an owner and pause new Runs of the affected Workflow until a person intervenes.","rationale":"A prompt edit, routing change or new tool can multiply cost without any error; the first signal should not be the monthly invoice.","evidence":{"static":"Alert rules on cost per Workflow and tenant with an automated pause action.","runtime":"Hourly cost per Workflow and tenant is derivable from telemetry.","attested":"Who is paged when a Workflow's spend exceeds its baseline, and what pauses automatically?"},"remediation":{"scope":"local","guidance":"Derive hourly cost per Workflow from `eas.cost.usd`, alert at a baseline multiple, and wire the alert to the kill switch (EAS-10.02)."},"components":["telemetry-pipeline","release-control"],"see_also":["EAS-10.02"],"section":"spend-as-an-alarm"},{"id":"EAS-05.14","title":"Planned degradation","level":"L3","applies":"Platforms running Workflows at volume.","requirement":"The platform MUST define a degradation order in advance (for example: shed background work, reduce low-priority tenants to their floor, shrink context, route to evaluated smaller models, queue interactive work with honest status). A Run MUST NOT be shed partway through its side effects; capacity for in-flight Runs MUST be reserved before new work is admitted.","rationale":"Degradation decided during an incident is improvised; a Run abandoned between two side effects leaves the world half-changed.","evidence":{"attested":"What is the documented degradation order, and how does admission protect Runs with in-flight side effects?","static":"Admission logic distinguishes Runs with committed but unexecuted ActionIntents."},"remediation":{"scope":"structural","guidance":"Document the degradation order as a runbook and encode in-flight protection in the scheduler."},"components":["scheduler","model-gateway"],"section":"degrading-on-purpose"}]},
    {"domain":"EAS-06","order":6,"slug":"identity","title":"Delegated Identity","essay":"06-delegate-identity-narrow-scope","summary":"An agent never acts as itself. Every Run acts on behalf of a Principal, with a Credential that carries that Principal's identity and no more authority than the task requires; delegation only narrows scope, identity never comes from model output, and the systems that hold data enforce it.","controls":[{"id":"EAS-06.01","title":"No identity from model arguments","level":"L1","applies":"All Tools.","requirement":"Tools MUST NOT accept the tenant, user, principal or their permissions as model-supplied arguments. Identity and tenancy MUST be taken from the Run's authenticated Credential.","rationale":"If a Tool takes a `tenant_id` parameter, the model fills it in, which means a prompt injection can fill it in. The model may choose which of the user's resources to look at; it must never choose whose resources are in scope.","evidence":{"static":"Inspect the input schema of every Tool exposed to the model, including sub-agent and third-party Tools. Any parameter that designates the tenant, user, customer, organisation or principal (for example `tenant_id`, `user_id`, `org_id`, `customer_id`, `on_behalf_of`) is a finding. Tool implementations obtain these values from the Run context or Credential."},"remediation":{"scope":"local","guidance":"Remove identity parameters from Tool schemas and read the tenant and Principal from the Run context injected by the framework, not from the ToolRequest."},"hooks":["tool.before"],"components":["tool-gateway"],"see_also":["EAS-06.02","EAS-02.03"],"section":"the-model-never-chooses-who-it-is"},{"id":"EAS-06.02","title":"Ownership verification on model-supplied identifiers","level":"L1","applies":"Tools that accept a resource identifier (order, account, document, ticket) from the model.","requirement":"Before reading or acting on a resource named by a model-supplied identifier, the Tool MUST verify that the resource belongs to the Run's tenant and is accessible to its Principal, and MUST return a not-found or denied result otherwise.","rationale":"A customer who asks about \"order 48213\" can read any order by typing its number unless the lookup checks that the order belongs to the authenticated customer. Identity comes from authentication, never from text.","evidence":{"static":"For each Tool taking a resource identifier, the lookup is constrained by the tenant and Principal from the Run's Credential (or performed by a data store enforcing the delegated identity). Tests exist that call the Tool with an identifier belonging to another tenant or Principal and assert a denied or not-found result.","attested":"What happens when a user of this Workflow supplies the identifier of a record belonging to another customer?"},"remediation":{"scope":"local","guidance":"Resolve every model-supplied identifier through a query scoped by the Run's tenant and Principal, and add a cross-tenant test case for each such Tool."},"components":["tool-gateway"],"see_also":["EAS-06.01","EAS-06.12"],"section":"the-model-never-chooses-who-it-is"},{"id":"EAS-06.03","title":"Per-Run delegated credential","level":"L2","applies":"All Workflows that access private or regulated data or perform effects.","requirement":"At the start of each Run the platform MUST mint a Credential whose subject is the Principal, which records the agent as actor, carries only the scopes the Workflow requires, and has a short expiry (for example by token exchange from the Principal's authenticated session). Tools MUST present this Credential to the systems they reach. Tools MUST NOT use a broad service credential shared across Principals.","rationale":"An agent running on the service's own broad credentials is a confused deputy: any tool call, whether correct, mistaken or induced by injection, can reach data its user could not, turning every other mistake into a breach.","evidence":{"declared":"`principal.type` and `principal.scopes` set for the Workflow; every `tools[].required_scopes` is a subset of `principal.scopes`.","static":"A `run.start` hook or identity broker mints the Credential (token exchange or equivalent) with subject, actor, scopes and expiry; Tool clients authenticate with the Run's Credential. Tools that read a database password, API key or service token from shared configuration to access Principal data are findings.","runtime":"Every `eas.run` span carries `eas.principal.type` and a non-empty `eas.actor_chain`.","attested":"When a Tool in this Workflow reads a customer's data, whose identity does the target system see?"},"remediation":{"scope":"structural","guidance":"Introduce an identity broker that exchanges the user's session for a narrowed, short-lived, actor-bearing token per Run, and migrate Tool clients from shared service credentials to that token."},"hooks":["run.start"],"components":["identity-broker"],"see_also":["EAS-06.04","EAS-04.02"],"section":"the-agent-acts-on-behalf-of-someone"},{"id":"EAS-06.04","title":"Delegation only narrows scope; actor chain recorded","level":"L2","applies":"Workflows that delegate to sub-agents or handoff targets.","requirement":"When control passes to a sub-agent, its Credential MUST be derived from the parent's (for example by a further token exchange) with scopes that are a subset of the parent's, limited to what the sub-agent's task requires, and the actor chain MUST be extended to record the sub-agent. Delegation MUST NOT widen scope.","rationale":"Recording each actor preserves accountability through every hop, and allowing each hop only to narrow makes delegation a way of reducing authority rather than accumulating it.","evidence":{"static":"A blocking `delegate` hook computes the child Credential as an intersection with the parent's scopes and appends to the actor chain; sub-agents that inherit the parent's Credential unchanged, or receive one minted independently with broader scopes, are findings.","runtime":"On spans of a sub-agent, `eas.actor_chain` equals the parent's chain plus exactly one additional actor."},"remediation":{"scope":"local","guidance":"In the delegation path, exchange the parent's token for one restricted to the sub-agent's declared Tools' scopes and record the sub-agent as an additional actor."},"hooks":["delegate"],"components":["identity-broker","orchestrator"],"see_also":["EAS-06.03","EAS-06.10"],"section":"the-agent-acts-on-behalf-of-someone"},{"id":"EAS-06.05","title":"Named service principals for non-human-triggered Runs","level":"L2","applies":"Workflows triggered by schedules or events rather than a user.","requirement":"Runs with no human Principal MUST act as a named service principal specific to the Workflow, with an explicit, reviewed set of grants. Such Runs MUST NOT act with the platform's general credentials.","rationale":"\"The system\" should never mean \"the platform with all its permissions\"; when someone asks why a Workflow could read some data, the answer should be in a reviewed policy, not the history of a shared credential.","evidence":{"declared":"`principal.type: service` with `principal.scopes` listing the Workflow's grants.","static":"The service principal is defined per Workflow in reviewed configuration (identity or IAM policy in version control); it is not shared with other Workflows or services.","attested":"Where is this Workflow's service principal defined, who reviewed its grants, and is it used by anything else?"},"remediation":{"scope":"local","guidance":"Create a dedicated service principal per scheduled or event-driven Workflow with only its declared scopes, and define its grants in version-controlled policy."},"hooks":["run.start"],"components":["identity-broker","scheduler"],"section":"the-agent-acts-on-behalf-of-someone"},{"id":"EAS-06.06","title":"No long-lived static secrets in agent runtime","level":"L2","applies":"All agent runtimes.","requirement":"The agent runtime MUST obtain its own identity from the platform (workload identity) rather than from long-lived static keys in code, images, environment configuration or files.","rationale":"Workload identity leaves no long-lived secret to leak.","evidence":{"static":"No cloud access keys, database passwords or long-lived API tokens in the repository, container images, deployment manifests or environment files for the runtime; cloud SDKs resolve credentials from the platform's workload identity.","attested":"How does the runtime authenticate to the cloud provider and to data stores, and which secrets, if any, are static?"},"remediation":{"scope":"local","guidance":"Bind the runtime's service account to a cloud role via workload identity and remove static keys from configuration."},"components":["identity-broker","executor"],"see_also":["EAS-06.11"],"section":"narrowing-at-the-infrastructure-layer"},{"id":"EAS-06.07","title":"Tenant-scoped shared stores","level":"L2","applies":"Multi-tenant Workflows.","requirement":"Every cache MUST include the tenant, and where relevant the user, in its key. Search indexes, vector stores and memory stores MUST separate tenants, and SHOULD do so physically (an index or namespace per tenant) rather than by a query-time metadata filter. Prompt-cache reuse MUST NOT allow one tenant's data to be served in another tenant's Run.","rationale":"Shared caches, indexes, memory and prompt caches with separation enforced by a query-time filter leak one customer's data into another's results when a filter is forgotten or a key omits the tenant.","evidence":{"static":"Inspect key construction for every cache used by Tools or the orchestrator; any key lacking the tenant is a finding. Inspect index and namespace selection in retrieval and memory code; shared indexes relying on a metadata filter are recorded and, at L3, are findings (see EAS-06.12).","attested":"Which stores hold tenant data across Runs, and how is each partitioned by tenant?"},"remediation":{"scope":"local","guidance":"Add the tenant from the Run context to every cache key centrally; move vector and memory data to per-tenant namespaces selected from the Run's Credential."},"hooks":["memory.write"],"components":["context-service","memory-store"],"see_also":["EAS-06.12","EAS-12.07"],"section":"enforcement-belongs-in-the-data-layer"},{"id":"EAS-06.08","title":"Explicit partial visibility","level":"L2","applies":"Tools whose results are filtered by the Principal's permissions.","requirement":"When permissions exclude results, the Tool MUST say so in its output (for example, \"results limited to records you have access to; some records were excluded\") so the model can qualify its answer.","rationale":"The model usually does not know it is seeing a subset and answers as if its view were complete. Silent subsets are a correctness problem disguised as a security feature.","evidence":{"static":"Permission-filtered Tools detect that filtering removed results (from the data store's response or a count comparison) and include an explicit marker in their output schema."},"remediation":{"scope":"local","guidance":"Add a `partial_due_to_permissions` field or equivalent to filtered Tools' output and a sentence in the result text."},"hooks":["tool.after"],"components":["tool-gateway"],"see_also":["EAS-08.01"],"section":"seeing-too-little"},{"id":"EAS-06.09","title":"Fail closed on permission-system failure","level":"L2","applies":"All Workflows reading customer data.","requirement":"If a permission cannot be confirmed because the permission system is unavailable or errors, reads of customer data MUST be denied. A cache of permission decisions MAY be used; its TTL MUST be an explicit number, documented and agreed with the security owner.","rationale":"Failing closed costs availability, and it is the right trade. A cache softens the cost but opens a window in which a revoked permission is honoured, so the window must be a deliberate number, not an accident of configuration.","evidence":{"static":"Error and timeout paths in permission checks return deny; permission cache TTL is set explicitly in configuration; a test simulates the permission service being unavailable and asserts denial.","attested":"What is the permission-cache TTL, where is it documented, and who in security agreed it?"},"remediation":{"scope":"local","guidance":"Treat exceptions in permission checks as deny, set the cache TTL explicitly, and record the agreed value next to the configuration."},"hooks":["tool.before"],"components":["policy-engine","identity-broker"],"section":"failing-closed-and-what-it-costs"},{"id":"EAS-06.10","title":"Audit at tool-call grain","level":"L2","applies":"All Workflows.","requirement":"Every Tool invocation MUST be recorded with the Run, the full actor chain, the Tool, the permissions used, the resources touched and the PolicyDecision, such that all access on behalf of a given tenant or Principal over a period can be retrieved by query.","rationale":"When a customer's security team asks for everything the AI accessed on their behalf last quarter, the answer should be a query.","evidence":{"static":"The tool interception point writes an audit record per invocation containing all six elements to a queryable store with retention matching the audit obligation.","runtime":"Every `execute_tool` span carries `eas.run.id`, `eas.actor_chain`, `eas.tenant.id` and `gen_ai.tool.name`, and is preceded by an `eas.policy` span for the same ToolRequest.","attested":"Produce the record of every resource this Workflow accessed on behalf of one named tenant during the last month."},"remediation":{"scope":"local","guidance":"Emit a structured audit record from the `tool.after` hook using the Run's Credential for actor chain and scopes and the Tool's result for resource identifiers."},"hooks":["tool.before","tool.after"],"components":["tool-gateway","telemetry-pipeline"],"see_also":["EAS-04.05","EAS-12.06"],"section":"audit-at-the-same-grain"},{"id":"EAS-06.11","title":"Per-Run narrowed cloud credentials","level":"L3","applies":"Workflows whose Tools access cloud resources directly.","requirement":"Each Run MUST receive short-lived cloud credentials narrowed for that Run (for example a role assumption with a session policy that can only reduce the role's permissions), tagged with at least the tenant and Run identifier, so that the cloud provider itself limits the Run to its tenant's resources.","rationale":"A Run acting for tenant A then holds credentials that, at the provider's own enforcement layer, can only reach tenant A's resources; a compromised Run is bounded by something the agent cannot negotiate with.","evidence":{"static":"Run start obtains session credentials with a session policy restricting resources to the tenant and session tags for tenant and Run; resource policies use the tags.","attested":"If a Run for tenant A requested an object belonging to tenant B, which layer would deny it?"},"remediation":{"scope":"structural","guidance":"Have the identity broker assume a per-Workflow role per Run with a tenant-scoped session policy and tenant and Run tags; key resource policies on those tags."},"hooks":["run.start"],"components":["identity-broker"],"see_also":["EAS-06.06","EAS-04.06"],"section":"narrowing-at-the-infrastructure-layer"},{"id":"EAS-06.12","title":"Data-layer enforcement","level":"L3","applies":"Workflows with `data_access` of `private` or `regulated`.","requirement":"Data stores reached by Tools MUST enforce the Principal's permissions themselves, using the Run's delegated identity — through row- and column-level security, or physically per-tenant indexes and namespaces — so that a Tool that omits a filter still receives only permitted data. Where a service connects on users' behalf by impersonation, the identities it may assume MUST be narrowly defined, reviewed and audited.","rationale":"Application-level filters depend on every Tool, written by every team, applying them correctly every time. Enforcement in the data layer turns an application bug into a denied query and an alert instead of a breach.","evidence":{"declared":"`policies[]` entries for data visibility with `enforced_at` including `data_layer`.","static":"Row- or column-level policies in the data store keyed on the session identity; per-tenant indexes for search and vector stores; impersonation configuration listing permitted identities, under review.","runtime":"Denied out-of-scope reads appear as `eas.policy` spans with `eas.policy.point = data_layer`.","attested":"Who may the impersonating service act as, who reviews that list, and where are its impersonations logged?"},"remediation":{"scope":"structural","guidance":"Start with application-level filtering plus physical tenant separation, then move enforcement into the data layer for agent workloads first, propagating the delegated identity to the store."},"components":["data-governance","identity-broker"],"see_also":["EAS-04.06","EAS-06.07"],"section":"enforcement-belongs-in-the-data-layer"},{"id":"EAS-06.13","title":"Execution-time credentials for deferred effects","level":"L2","applies":"Workflows in which an ActionIntent can be executed after a durable wait (human approval, a timer, an external event) or by an executor running apart from the Run.","requirement":"The executor MUST perform each deferred effect with a credential obtained at execution time: minted by token exchange from a stored delegation grant, narrowed to that ActionIntent's action and target, and short-lived. The Run's original credential MUST NOT be extended, refreshed or stored to bridge the wait. Before executing, the executor MUST confirm that the Principal still holds the authority the intent requires; if the grant has expired or been revoked, or the authority withdrawn, the intent MUST fail closed and return to review rather than execute.","rationale":"A Run's credential is deliberately short-lived, but approval as a state transition means an effect may execute days later. Keeping the original credential alive to cover that gap creates exactly the long-lived, broadly scoped secret the delegation model exists to avoid, and executes on authority that may since have been revoked.","evidence":{"declared":"`principal.execution_credential` is `per_intent`.","static":"The executor obtains a credential through the identity broker immediately before each effect, with scope derived from the intent's action type and target; no code path persists or refreshes the Run's credential for later use; the executor handles a refused exchange by failing the intent closed.","runtime":"Every `eas.execute` span carries `eas.credential.minted_for = intent` and an `eas.credential.age_s` below the configured lifetime; no `eas.execute` span reuses the credential identifier of the originating Run.","attested":"If a user's access is revoked while one of their intents awaits approval, what happens when a reviewer approves it?"},"remediation":{"scope":"structural","guidance":"Store a narrow delegation grant with each intent at commit time (not a token); have the executor exchange it for an intent-scoped credential at execution, and treat a refused exchange as a rejection that returns the intent to review."},"hooks":["state.resume"],"components":["identity-broker","executor","action-ledger"],"see_also":["EAS-06.03","EAS-06.09","EAS-03.07","EAS-09.02"],"section":"the-agent-acts-on-behalf-of-someone"}]},
    {"domain":"EAS-07","order":7,"slug":"untrusted-content","title":"Untrusted Content","essay":"07-untrusted-content-is-data","summary":"There is no complete defence against prompt injection at the model layer, so the architecture assumes the model will sometimes be persuaded and limits what a persuaded model can do: every source is classified by trust, no Run holds private data, untrusted exposure and an external channel without a deterministic control between them, and untrusted content is never in a position to give orders.","controls":[{"id":"EAS-07.01","title":"Trust inventory","level":"L1","applies":"All Workflows.","requirement":"Every Tool and every context source MUST be classified by `output_trust` (`trusted` or `untrusted`), `data_access` (`none`, `private`, `regulated`) and `egress` (whether it can communicate outside the trust boundary, including by rendering a URL). Content whose author the operator does not control MUST be classified `untrusted`, including data in the operator's own systems that originated outside, inbound messages, user-uploaded documents, web pages and third-party Tool output.","rationale":"Reasoning about injection risk starts from knowing which capabilities a Run holds; the combination of private data, untrusted exposure and external communication cannot be found without this inventory.","evidence":{"declared":"`tools[].output_trust`, `tools[].data_access` and `tools[].egress` are set for every Tool; every entry in `context.sources[]` is classified.","static":"Every Tool registered in code — including sub-agent, built-in, hosted and MCP Tools — appears in the manifest; classifications are plausible (for example a Tool that fetches URLs, reads inbound email or reads free-text fields entered by customers is not `trusted`; a Tool that posts, sends, calls an external API or writes where others read is `egress: true`).","runtime":"Every `execute_tool` span carries `eas.tool.output_trust` and `eas.tool.egress`, matching the manifest."},"remediation":{"scope":"local","guidance":"Enumerate Tools from the framework's registry and context sources from retrieval configuration, classify each in the manifest, and default unknown sources to `untrusted`."},"components":["tool-gateway","context-service"],"see_also":["EAS-07.02","EAS-03.01"],"section":"the-dangerous-combination"},{"id":"EAS-07.02","title":"No ungated lethal combination","level":"L1","applies":"All Workflows.","requirement":"A Run MUST NOT hold access to private or regulated data, exposure to untrusted content, and the ability to communicate externally without a deterministic control between them. Where a Workflow needs all three, the external channel MUST be constrained by a deterministic control (for example replies only to the verified sender in a structured format, a taint rule requiring approval, or quarantine of the untrusted content) and unusual cases MUST go to a person. Rendering a link or image whose URL the model can influence counts as external communication.","rationale":"An agent with all three can be turned into an exfiltration tool: the untrusted content carries the instructions, the private data is the payload and the external channel is the exit. Removing or gating any one of them makes the attack fail.","evidence":{"declared":"From `tools[]` and `context.sources[]`, for each Workflow: P = any Tool with `data_access` of `private` or `regulated`; U = any Tool with `output_trust: untrusted` or any untrusted context source or Run input; E = any Tool with `egress: true`. Where P, U and E all hold, at least one `policies[]` entry with `enforced_at` of `gateway`, `output` or `network` names the gating control.","static":"Procedure. (1) For each Workflow, determine the set of Tools reachable within one Run: the root agent's Tools plus those of every sub-agent, handoff target or nested workflow that executes under the same Run (sharing its Credential or context). (2) Add the context sources and Run inputs (inbound messages, uploads) that enter any of those agents. (3) Add an implicit egress Tool if any model output is rendered as markdown, HTML, links or images by a client, unless the renderer restricts URLs to an allowlist. (4) Evaluate P, U and E over the union; splitting the three across sub-agents of the same Run does not remove the combination unless their contexts and Credentials are actually separate. (5) If all three hold, locate the deterministic control between untrusted exposure and egress — a taint rule (EAS-07.03), a recipient or destination constraint in the policy gate, quarantine (EAS-07.09), or plan-before-read. No such control is a finding.","runtime":"No Run contains an `execute_tool` span with `eas.tool.egress = true` after `eas.run.tainted = true` unless that ToolRequest is preceded by an `eas.policy` span whose `eas.policy.rule_id` identifies a gating rule.","attested":"For this Workflow, if a retrieved document instructed the agent to send customer data to an outside address, which deterministic control would stop it?"},"remediation":{"scope":"local","guidance":"Remove the capability not required by the task (often the send Tool), or add a gate: constrain recipients and destinations to verified targets from the system of record, and require approval for egress once the Run is tainted."},"hooks":["tool.before","tool.after"],"components":["policy-engine","tool-gateway"],"see_also":["EAS-07.03","EAS-07.04","EAS-07.09","EAS-04.02"],"section":"the-dangerous-combination"},{"id":"EAS-07.03","title":"Run-level taint","level":"L2","applies":"Workflows with any untrusted Tool or context source.","requirement":"When output from an untrusted Tool or context source enters the context of any agent in a Run, the Run MUST be marked tainted, and taint MUST NOT be reset within the Run. Once tainted, high-risk capabilities — external sends, data exports, permission changes and large financial actions — MUST require human approval or be denied for the rest of the Run. Taint MAY be tracked at a finer grain (specific values) provided high-risk actions influenced by tainted values are equally restricted.","rationale":"Even coarse, whole-Run taint removes most of the risk at little cost, because most Runs that read untrusted content do not need to take high-risk actions afterwards.","evidence":{"static":"A `tool.after` hook (or retrieval wrapper) sets taint from the source's classification; the policy gate reads taint from the Run and maps high-risk Tools to `escalate` or `deny` when tainted; taint is carried across sub-agents within the Run.","runtime":"No `execute_tool` span with `eas.tool.egress = true` or `eas.tool.effect_class = irreversible` and `eas.run.tainted = true` exists without a preceding `eas.policy` span whose decision is `escalate`, or an `eas.intent` span with `eas.intent.approval = human`."},"remediation":{"scope":"local","guidance":"Mark the Run tainted in `tool.after` based on the Tool's `output_trust`, and add a gate rule that escalates high-risk Tools on tainted Runs."},"hooks":["tool.after","tool.before","memory.write"],"components":["policy-engine","orchestrator","approval-service"],"see_also":["EAS-07.02","EAS-04.02","EAS-03.07"],"section":"patterns-that-work"},{"id":"EAS-07.04","title":"Least-privilege tool sets","level":"L1","applies":"All Workflows.","requirement":"Each Workflow MUST expose only the Tools its task requires; read access unless writes are required; reversible writes unless irreversible ones are required. An agent whose task ends at a draft for review MUST NOT have a send Tool. Actions SHOULD carry rate limits, budgets and approvals tiered by risk.","rationale":"Excessive agency gives a successful injection more to work with; least privilege applied to the tool set limits what a persuaded model can do.","evidence":{"declared":"`tools[]` with `effect_class`, `egress` and `approval` for each Tool, read against the Workflow's `success_definition`.","static":"For each Tool with `effect_class` other than `none` or with `egress: true`, a step of the Workflow's task requires it; generic Tools (shell, arbitrary HTTP, arbitrary query) where a narrower one would serve are findings; draft-only Workflows have no send or publish Tool.","runtime":"Tools declared for a Workflow but never invoked across the sample are reported as removal candidates.","attested":"For each write, irreversible or egress Tool, which part of the task needs it?"},"remediation":{"scope":"local","guidance":"Remove unused and over-broad Tools; replace generic Tools with narrow, typed ones; route sends through a draft and approval flow."},"components":["tool-gateway"],"see_also":["EAS-03.01","EAS-03.08","EAS-05.05"],"section":"least-privilege-applied-to-tools"},{"id":"EAS-07.05","title":"Egress control","level":"L2","applies":"All agent runtimes.","requirement":"Agent runtimes MUST NOT have direct internet access. Outbound traffic MUST pass through a proxy that allows only the model providers and registered Tool endpoints.","rationale":"If an injected instruction persuades the agent to send data to an unknown address, the network refuses, even when everything above it has been fooled.","evidence":{"declared":"`policies[]` entry with `enforced_at: network` describing the allowlist.","static":"Network policy or security groups deny default egress from the runtime; proxy configuration holds an allowlist that matches the declared model providers and Tool endpoints; Tools that fetch arbitrary URLs go through the same proxy.","runtime":"Denied egress attempts are logged by the proxy and appear as `eas.policy` spans with `eas.policy.point = network`.","attested":"From inside the runtime, what happens on a request to an address not on the allowlist?"},"remediation":{"scope":"structural","guidance":"Place the runtime in a network segment with no default route to the internet and an egress proxy with an allowlist derived from the manifest."},"components":["egress-proxy"],"see_also":["EAS-04.06"],"section":"patterns-that-work"},{"id":"EAS-07.06","title":"Third-party tool supply chain","level":"L2","applies":"Workflows using Tools with `source` of `third_party` or `mcp`.","requirement":"Tool descriptions and schemas from third-party servers MUST be reviewed when a server is approved, and a hash of each MUST be recorded. A server whose descriptions or schemas change MUST NOT be used until they are reviewed again. Each agent MUST see only the Tools of servers it needs. Agents MUST connect only to approved servers, through a gateway that logs and inspects traffic, using tokens bound to the specific audience and never passed through from one service to another.","rationale":"Tool descriptions are placed in the model's context, so a malicious or compromised server can poison them or shadow other servers' Tools, and a server that was benign at review can change later. The defences are supply-chain defences.","evidence":{"declared":"`tools[].source{type, server, description_sha256}` for every third-party Tool.","static":"At connection or load time, descriptions and schemas are hashed and compared with the pinned values, and a mismatch disables the server; each agent's Tool list is an explicit subset rather than all connected servers; server URLs come from an approved list routed via the gateway; tokens are requested per audience and not forwarded.","attested":"Who reviews a new or changed third-party Tool server, and what happens automatically when its descriptions change?"},"remediation":{"scope":"structural","guidance":"Introduce a tool gateway that holds the approved server list and pinned description hashes, filters Tools per agent, and handles audience-bound authorisation."},"components":["tool-gateway","identity-broker"],"see_also":["EAS-07.08","EAS-10.01"],"section":"the-channels-people-forget"},{"id":"EAS-07.07","title":"Memory provenance","level":"L2","applies":"Workflows with `memory.enabled`.","requirement":"Every MemoryEntry MUST record the Run that wrote it, its source and whether that source was trusted. Entries written by a tainted Run or derived from untrusted content MUST be stored with lower trust or not stored at all, and a Run that reads lower-trust memory MUST treat it as untrusted content.","rationale":"If later Runs trust what is remembered, an injection becomes persistent: a malicious email processed today writes a \"fact\" that a Run next week acts on, long after anyone would connect the two.","evidence":{"declared":"`memory.provenance` enabled and `memory.untrusted_policy` set to `exclude` or `downgrade`.","static":"A `memory.write` hook attaches writer Run, source and trust and applies the untrusted policy based on Run taint; memory reads mark low-trust entries as untrusted ContextItems (and taint the reading Run)."},"remediation":{"scope":"local","guidance":"Wrap memory writes in a hook that records provenance from the Run and downgrades or drops entries from tainted Runs."},"hooks":["memory.write"],"components":["memory-store"],"see_also":["EAS-07.03","EAS-12.07"],"section":"the-channels-people-forget"},{"id":"EAS-07.08","title":"Injection regression suite","level":"L2","applies":"All Workflows with any untrusted Tool or context source.","requirement":"A corpus of injection attempts — direct and indirect, encoded, multi-turn, and delivered through documents, Tool outputs and Tool descriptions — MUST be run as a regression suite on every change to a prompt, model, Tool or policy. Attack success rate MUST be tracked by category, and an increase MUST block the release as a functional regression would.","rationale":"No defence is complete, so testing must be continuous and treated as part of the release gate.","evidence":{"declared":"`evaluation.gates[]` includes an injection attack-success-rate gate referencing the corpus in `evaluation.suite`.","static":"The corpus exists, is versioned and covers each delivery channel the Workflow has; CI runs it on changes to prompts, models, Tool definitions and policies; results are reported per category with a blocking threshold.","attested":"When did an injection regression last block a release, and what changed?"},"remediation":{"scope":"local","guidance":"Seed a corpus from public injection datasets and past incidents, run it in the evaluation pipeline, and gate on per-category attack success rate."},"components":["eval-platform","release-control"],"see_also":["EAS-10.07","EAS-07.11"],"section":"testing-as-a-programme"},{"id":"EAS-07.09","title":"Constrained control flow for high-risk Workflows","level":"L3","applies":"Workflows that read untrusted content and send messages, change records or move money.","requirement":"Such Workflows MUST ensure untrusted content can flow only as data, by at least one of: (a) plan-before-read — the Tools to call, their order and their targets are fixed from trusted input before any untrusted content is read; or (b) quarantine — untrusted content is processed by a separate ModelCall with no Tools and no access to sensitive data, which returns a tightly constrained, schema-validated result, and the privileged part of the system never sees the raw text.","rationale":"If control flow is derived only from trusted input, untrusted content can influence what is written but cannot add a Tool call or change a recipient; an injection reduced to a few validated fields has little room to carry instructions.","evidence":{"static":"For plan-before-read: the Workflow's Tool sequence and targets are determined in code or by a ModelCall that precedes any untrusted read, and later ModelCalls fill content only. For quarantine: the ModelCall receiving untrusted text has no Tools bound and no private context; its output schema uses enumerations and bounded fields; only the validated structure reaches the privileged agent.","attested":"Which pattern does this Workflow use, and at which point does untrusted content enter it?"},"remediation":{"scope":"structural","guidance":"Restructure the Workflow as a fixed workflow with model-filled content slots, or insert a tool-less, schema-constrained extraction step in front of the privileged agent."},"components":["orchestrator","model-gateway"],"see_also":["EAS-07.02","EAS-01.01"],"section":"patterns-that-work"},{"id":"EAS-07.10","title":"Production injection detection","level":"L3","applies":"Workflows in production with any untrusted Tool or context source.","requirement":"Production MUST include honeytokens (for example a contact that must never be emailed, a document that must never be read) that raise an alert when touched, and MUST alert on spikes in policy rejections.","rationale":"Because no defence is complete, detection in production surfaces attempts that tests missed; spikes in policy rejections are a signal, not noise.","evidence":{"static":"Honeytoken records exist in the data reachable by the Workflow, with deny rules and alerts bound to them; alert rules on rejection rate per Workflow.","runtime":"The rate of `eas.policy` spans with `eas.policy.decision = deny` per Workflow is monitored with an alert threshold; honeytoken access produces an alert.","attested":"When did a honeytoken or rejection-spike alert last fire, and who responded?"},"remediation":{"scope":"local","guidance":"Plant honeytokens in each data domain the agent can read and contact, add deny rules that alert, and alert on deny-rate anomalies."},"components":["telemetry-pipeline","policy-engine"],"see_also":["EAS-04.05"],"section":"testing-as-a-programme"},{"id":"EAS-07.11","title":"Coverage mapped to OWASP LLM Top 10 and MITRE ATLAS","level":"L3","applies":"All Workflows assessed at L3.","requirement":"Injection and security test coverage MUST be mapped to the OWASP Top 10 for LLM applications and MITRE ATLAS, showing which risks and techniques are tested and which are not.","rationale":"Mapping coverage to these frameworks gives security reviewers a shared vocabulary for what has and has not been tested.","evidence":{"static":"A maintained mapping from test cases and controls to OWASP LLM Top 10 entries and ATLAS techniques, with gaps listed.","attested":"Which OWASP LLM Top 10 risks and ATLAS techniques are not covered by tests, and why?"},"remediation":{"scope":"local","guidance":"Tag each corpus case and control with framework identifiers and generate the coverage table from the tags."},"components":["eval-platform"],"see_also":["EAS-07.08"],"section":"testing-as-a-programme"}]},
    {"domain":"EAS-08","order":8,"slug":"context","title":"Context Budget","essay":"08-context-is-a-budget","summary":"The model receives the smallest context sufficient for the task, assembled deliberately: each kind of fact comes from its natural source, every ContextItem is sized and explicitly partial when truncated, every fact carries the time it was true as of, and whether the context was sufficient is measured.","controls":[{"id":"EAS-08.01","title":"Explicit truncation and pagination","level":"L1","applies":"All Tools whose output is returned to the model.","requirement":"A Tool response that would exceed the Tool's output limit MUST either be summarised, with the details available through a further request, or be paginated with a cursor the model can use to request more. Any response that is partial MUST say so in its content, and the resulting ContextItem MUST be marked `truncated`. Silent truncation (cutting the output with no indication) MUST NOT occur.","rationale":"A model that is not told a result is partial will mistake a subset for the whole. Unbounded output is both a context bug, crowding out everything else, and a load bug on the systems behind the Tool.","evidence":{"declared":"`tools[].output_limit_tokens` is set for every Tool (see EAS-05.06).","static":"Each Tool, or a shared `tool.after` hook, handles over-limit output by summarising or by returning a page plus a continuation cursor, and adds an explicit partial marker (for example `truncated: true`, `total_count`, `next_cursor`) to the response returned to the model. Slicing a string or list to a size with no marker is a finding. Limits are measured in tokens, not rows.","runtime":"No `execute_tool` span has `eas.tool.output_tokens` above the Tool's declared limit; spans whose raw output exceeded the limit carry `eas.tool.output_truncated = true`; in sampled captured payloads, every truncated output contains an explicit partial marker."},"remediation":{"scope":"local","guidance":"Implement truncation once in a shared `tool.after` hook that counts tokens, cuts at the limit, and appends a structured partial marker and cursor; add cursor parameters to list and search Tools."},"hooks":["tool.after"],"components":["tool-gateway"],"see_also":["EAS-05.06"],"section":"every-tool-has-a-size-limit"},{"id":"EAS-08.02","title":"Structured facts via structured lookups","level":"L1","applies":"All Workflows that give the model facts about specific entities (plan, status, score, configuration).","requirement":"Facts that have exactly one correct current value in a system of record MUST be supplied to the model by a keyed, structured lookup against that record or its snapshot, and MUST NOT be obtained by similarity search over embedded copies. Similarity retrieval SHOULD be reserved for unstructured ContextItems (documents, notes, manuals, past conversations).","rationale":"Similarity search finds passages that discuss something; it is the wrong tool for answering \"what is this customer's current plan?\", which has exactly one correct answer sitting in a database.","evidence":{"declared":"`context.sources[]` lists each source with its `kind`; sources of kind `slow` or `fresh` are backed by keyed lookups, and only sources of kind `unstructured` are backed by a vector index.","static":"Inspect what is written to vector indexes: embedding entity records, account fields, statuses or scores is a finding. Entity facts reach the context through Tools or context-service calls keyed by entity identifier.","runtime":"ModelCall spans show entity facts under `eas.context.tokens.slow` or `eas.context.tokens.fresh`, not under `eas.context.tokens.unstructured`."},"remediation":{"scope":"local","guidance":"Replace similarity retrieval of entity facts with a keyed lookup Tool or snapshot read; remove structured records from the embedding pipeline."},"components":["context-service"],"section":"the-wrong-primitive"},{"id":"EAS-08.03","title":"No arbitrary generated queries against production stores","level":"L1","applies":"Workflows at rung `agent` or `multi_agent` that act without a person reading each query result. Analyst assistants whose output a person reviews are out of scope.","requirement":"An autonomous agent MUST NOT be able to compose and execute arbitrary queries (for example generated SQL) against production data stores. Data access MUST go through parameterised query templates: a fixed set of queries the Tool knows how to run efficiently, with the model supplying only parameters.","rationale":"Generated queries from an unsupervised agent mean unbounded cost, unpredictable query plans that can harm shared systems, and a path for injected instructions to reach the database. Templates keep most of the flexibility with none of these risks.","evidence":{"declared":"No entry in `tools[]` accepts a free-form query language string as an argument.","static":"Tool input schemas contain typed parameters only; Tool implementations bind parameters into fixed query text. Any Tool that passes a model-supplied string to a query engine, or concatenates model output into query text, is a finding.","attested":"Can any autonomous Workflow cause a query to run against a production store whose text was not written by an engineer?"},"remediation":{"scope":"local","guidance":"Inventory the questions the agent actually asks of the store and replace the free-form query Tool with one parameterised Tool (or template) per question, each with bounded result size."},"hooks":["tool.before"],"components":["tool-gateway"],"see_also":["EAS-02.03","EAS-07.01"],"section":"the-wrong-primitive"},{"id":"EAS-08.04","title":"Cache-friendly prompt structure","level":"L2","applies":"All Workflows making repeated ModelCalls with shared instructions.","requirement":"Static ContextItems (system instructions, policies, tool definitions) MUST be placed in a fixed prefix at the start of the prompt, identical across Runs of the same Workflow version, ahead of any per-Run or per-Step content, so that provider prompt caching can apply.","rationale":"Static context is the same for every Run of a Workflow; in a fixed prefix it can be cached by the provider and charged at a fraction of the usual price on repeated calls.","evidence":{"static":"Prompt assembly orders static content first and contains no per-Run values (timestamps, identifiers, user data) inside the static prefix; provider cache controls are enabled where the provider requires them.","runtime":"`eas.context.tokens.static` is constant across ModelCalls of a Workflow version; provider-reported cached input tokens are non-zero on repeated calls where the provider reports them."},"remediation":{"scope":"local","guidance":"Restructure prompt templates so that all static content precedes variable content, move dynamic values out of the system prompt, and enable provider caching."},"hooks":["model.before"],"components":["context-service","model-gateway"],"section":"not-all-context-is-the-same"},{"id":"EAS-08.05","title":"Precomputed snapshots for slow-changing facts","level":"L2","applies":"Workflows that use scores, classifications, profiles or configuration produced by batch pipelines.","requirement":"Slow-changing facts MUST be read from precomputed snapshots (compact per-entity documents refreshed when the producing pipeline publishes) and MUST NOT be recomputed at query time by a Tool. Agents MUST read the same precomputed results as the rest of the product. Deep analytical requests (large aggregations or joins over long histories) SHOULD be explicit, run within strict limits, preferably asynchronously, and return a summary rather than the raw result.","rationale":"Re-aggregating a month of activity to recompute a score a batch job produced last night is wasteful at best and inconsistent at worst, because the agent's figure may disagree with the one the product shows.","evidence":{"declared":"`context.sources[]` includes sources of kind `slow` naming the snapshot each reads from.","static":"No Tool reimplements an aggregation or scoring computation that an existing pipeline already produces; slow facts are read from the pipeline's published output. Analytical Tools enforce row, time and cost limits.","attested":"For each score or classification the agent uses, which pipeline produces it, and does the agent read that output or compute its own?"},"remediation":{"scope":"structural","guidance":"Publish per-entity snapshot documents from the existing pipelines and replace query-time aggregation Tools with snapshot reads."},"components":["context-service"],"see_also":["EAS-08.06"],"section":"not-all-context-is-the-same"},{"id":"EAS-08.06","title":"Freshness labels and SLAs","level":"L2","applies":"All Workflows whose decisions depend on facts that change over time.","requirement":"Every ContextItem carrying a fact MUST include its `as_of` time, visible to the model. Freshness requirements MUST be defined per kind of context and per kind of decision rather than as one global target. The platform MUST refuse or flag an action whose required inputs are older than that action tolerates, and stale context MUST be observable and alert the owner of the producing pipeline.","rationale":"Labels let the model account for gaps, let evaluation separate bad data from bad reasoning (which have different fixes), and turn staleness into a pipeline alert instead of an agent quietly acting on yesterday's information.","evidence":{"declared":"`context.sources[].freshness_sla_s` is set for every source of kind `slow` or `fresh`.","static":"Tool and context-service responses include an `as_of` field for each fact; a check before consequential ToolRequests compares input ages against the action's freshness requirement and denies or escalates.","runtime":"ModelCall spans carry `eas.context.stale_items`; no `execute_tool` span with `eas.tool.effect_class` other than `none` follows a ModelCall with `eas.context.stale_items > 0` in the same Step without an `eas.policy` span whose decision is `deny` or `escalate`.","attested":"Who is alerted when a context source exceeds its freshness SLA?"},"remediation":{"scope":"local","guidance":"Add `as_of` to every Tool response in a `tool.after` hook, declare freshness SLAs per source, and add a freshness rule to the policy gate for consequential Tools."},"hooks":["tool.after","tool.before"],"components":["context-service","policy-engine","telemetry-pipeline"],"section":"freshness-is-part-of-the-data"},{"id":"EAS-08.07","title":"Long-run context management","level":"L2","applies":"Workflows at rung `agent` or `multi_agent` whose Runs can exceed a small number of Steps.","requirement":"The context window MUST be managed as working memory, not as a log of the Run. Workflows MUST apply at least one of: compaction (periodically summarising older history while retaining decisions, open questions, identifiers and commitments); sub-agent isolation (exploratory work in a separate agent that returns only a compact result); or structured notes (important findings written to durable state and re-read when needed).","rationale":"Each Step adds tool results and reasoning, and a fifty-Step Run can accumulate far more than the model can use well. What needs to persist should persist somewhere designed for it.","evidence":{"static":"A compaction step, sub-agent delegation for exploratory work, or a notes mechanism backed by durable state exists in the orchestration; compaction prompts or code preserve decisions, identifiers and commitments explicitly.","runtime":"The sum of `eas.context.tokens.*` per ModelCall does not grow without bound with Step count; in long Runs it stays below a declared ceiling."},"remediation":{"scope":"local","guidance":"Add a `model.before` check that triggers compaction above a context threshold, and move exploratory search into a sub-agent with a compact return contract."},"hooks":["model.before","delegate"],"components":["orchestrator","context-service","state-store"],"see_also":["EAS-05.02"],"section":"context-across-long-runs"},{"id":"EAS-08.08","title":"Relevant tool definitions only","level":"L2","applies":"Workflows exposing many Tools.","requirement":"The tool definitions included in a ModelCall SHOULD be limited to the Tools relevant to the current Step, so that tool definitions are budgeted like any other ContextItem. Selection MUST be deterministic and SHOULD preserve a stable prompt prefix (see EAS-08.04).","rationale":"The goal is the smallest context sufficient for the task; irrelevant material, including unused tool definitions, costs on every call and makes relevant facts more likely to be missed.","evidence":{"static":"Tool sets are selected per Step or per phase by orchestration code, not passed wholesale to every ModelCall.","attested":"How many tool definitions does the model see at each Step, and how was that set chosen?"},"remediation":{"scope":"local","guidance":"Group Tools by Workflow phase and bind only the group for the current phase; keep group definitions stable so each phase has a cacheable prefix."},"hooks":["model.before"],"components":["orchestrator"],"see_also":["EAS-07.04","EAS-08.04"],"section":"not-all-context-is-the-same"},{"id":"EAS-08.09","title":"Isolated agent traffic","level":"L3","applies":"Platforms where agent Tools call backends shared with human-facing products.","requirement":"Agent traffic to Tool backends MUST be isolated in its own capacity pool or queue, rate-limited per tenant, and served from caches and snapshots wherever possible. Every such cache key MUST include the tenant.","rationale":"An agent is a different kind of client from a person: dozens of calls per Run, fan-out across hundreds of entities, retries, at any hour across every tenant at once. Tenant-less cache keys are the most common route by which one customer's data appears in another's results.","evidence":{"static":"Tool backends route agent traffic to a dedicated pool, replica or queue; per-tenant rate limits are configured; cache keys include the tenant identifier.","runtime":"Every `execute_tool` span carries `eas.tenant.id`; per-tenant rate-limit rejections are observable.","attested":"If agent traffic spikes, which human-facing systems share capacity with it, and what protects them?"},"remediation":{"scope":"structural","guidance":"Put agent-facing reads behind a dedicated pool or read replica with per-tenant rate limits, and serve high-volume reads from tenant-keyed caches and snapshots."},"components":["tool-gateway","scheduler"],"see_also":["EAS-05.07","EAS-06.07"],"section":"every-tool-has-a-size-limit"},{"id":"EAS-08.10","title":"Context sufficiency measured","level":"L3","applies":"All Workflows with an EvalSuite.","requirement":"For each eval case, the EvalSuite MUST record which facts the correct answer depends on, and evaluation MUST check whether those facts were present in the context the agent actually received. \"Answered without the needed information\" MUST be tracked as a distinct failure category, separate from reasoning failures.","rationale":"If the needed facts were missing, the problem is upstream of the model and no prompt engineering will fix it; a significant share of apparent model error is really context error.","evidence":{"declared":"`evaluation.suite` is set, and the dataset schema includes required facts per case.","static":"Eval cases annotate required facts; the evaluator inspects the assembled context recorded for each case and reports a missing-context failure category.","attested":"What share of eval failures last release were missing-context failures, and how was that measured?"},"remediation":{"scope":"local","guidance":"Annotate required facts on existing eval cases and add a deterministic check against the recorded context for each case."},"components":["eval-platform"],"see_also":["EAS-10.04"],"section":"was-the-context-enough"}]},
    {"domain":"EAS-09","order":9,"slug":"durable-state","title":"Durable State","essay":"09-durable-state-replay-without-recomputation","summary":"A Run's progress survives anything that can happen to the machines running it: state is checkpointed at every Step boundary, waiting costs nothing, resume never repeats a side effect, Decisions once made are read rather than recomputed, and every Run follows one consistent Workflow version from start to finish.","controls":[{"id":"EAS-09.01","title":"No effects before a pause point within the same Step","level":"L1","applies":"All Workflows with pause points (human approval, interrupts, external events).","requirement":"Code that performs a side effect MUST NOT execute within the same Step before a pause point. Side effects MUST be placed in their own Step (or recorded task) whose completion is persisted in the Checkpoint before the pause, so that resuming never repeats them. The Workflow owner MUST be able to state exactly what re-executes when a paused Run resumes in the framework in use.","rationale":"Many frameworks re-run an interrupted Step from its beginning on resume, not from the line where it paused; in LangGraph, for example, code before `interrupt()` in a node runs a second time, so an email sent there goes twice.","evidence":{"static":"For every function or node containing a pause primitive, no effectful Tool call, ActionIntent execution or external write occurs on the path before the pause. The stack profile states the framework's resume semantics.","runtime":"Within a Run, no `execute_tool` span with `eas.tool.effect_class` other than `none` is repeated with the same `eas.tool.args_fingerprint` before and after an `eas.wait` span.","attested":"What exactly re-executes when a paused Run resumes, and what is guaranteed to have been persisted before a side effect happens?"},"remediation":{"scope":"local","guidance":"Split each Step that both acts and pauses into two: an effect Step whose completion is checkpointed, then a pause Step; or route the effect through the action ledger with a semantic idempotency key."},"hooks":["state.checkpoint","state.resume"],"components":["orchestrator"],"see_also":["EAS-03.03","EAS-03.07"],"section":"know-what-re-executes-on-resume"},{"id":"EAS-09.02","title":"Durable waiting","level":"L2","applies":"All Workflows that wait for a person, a timer or an external event.","requirement":"When a Run must wait, it MUST write its Checkpoint, enter status `waiting` and release its worker. Waiting MUST NOT hold a process, thread, coroutine, open connection or in-memory future.","rationale":"Three days of waiting should cost a row in a database. A design that holds a process open to wait for a human loses every waiting Run at the first deploy, restart or node failure.","evidence":{"declared":"`state.checkpointer` names a durable store.","static":"Approval and timer waits are implemented as checkpoint-and-exit with resume triggered by an event or scheduler, not as awaiting a future, polling loop or sleep inside a live worker.","runtime":"Waits appear as `eas.wait` spans; Runs whose `eas.wait` spans span a deploy or worker restart resume and reach a terminal status.","attested":"If every worker were restarted now, what would happen to Runs currently waiting for approval?"},"remediation":{"scope":"structural","guidance":"Replace in-process waits with a durable pause: checkpoint, mark the Run `waiting`, and resume via a scheduler or event handler that loads the Checkpoint."},"hooks":["state.checkpoint","state.resume"],"components":["orchestrator","state-store","scheduler"],"see_also":["EAS-03.07","EAS-05.03"],"section":"waiting-should-cost-nothing"},{"id":"EAS-09.03","title":"Checkpoint at every Step boundary","level":"L2","applies":"All Workflows with more than one Step.","requirement":"The state of every Run MUST be written to a durable store at every Step boundary, and each Checkpoint MUST capture everything needed to resume from it. Resume MUST start from the last committed Checkpoint for that Run. When Steps run in parallel and one fails, results of the Steps that succeeded SHOULD be retained so that a retry reruns only the failure.","rationale":"Durability means nothing completed is lost when a worker dies; resumability requires that the Checkpoint holds everything needed to continue.","evidence":{"declared":"`state.checkpointer` names a durable store (not in-memory).","static":"A durable checkpointer is configured for every Workflow in production code paths; in-memory checkpointers appear only in tests.","runtime":"Every completed `eas.step` span is followed by a committed Checkpoint before the next `eas.step` begins."},"remediation":{"scope":"local","guidance":"Configure the framework's durable checkpointer against a production database and remove in-memory checkpointers from deployed configuration."},"hooks":["state.checkpoint"],"components":["orchestrator","state-store"],"section":"four-concerns-often-blurred-together"},{"id":"EAS-09.04","title":"Synchronous durability for effectful Workflows","level":"L2","applies":"Workflows with any Tool whose `effect_class` is not `none`.","requirement":"Where the framework offers a choice of durability mode, Workflows that take actions MUST checkpoint synchronously, so that a Step's Checkpoint is committed before the next Step begins. Asynchronous or end-of-Run checkpointing MUST NOT be used for such Workflows.","rationale":"An asynchronous Checkpoint lost in a crash means the last Step runs again, and if that Step had an effect, the effect happens twice.","evidence":{"declared":"`state.durability` is set to `sync` for the Workflow.","static":"The framework's durability or checkpoint mode is set explicitly to synchronous for effectful Workflows; a framework default counts only if the profile confirms it is synchronous.","runtime":"For effectful Workflows, no `eas.step` span starts before the previous Step's Checkpoint commit has completed."},"remediation":{"scope":"local","guidance":"Set the durability mode explicitly in Workflow configuration and declare it in the manifest."},"hooks":["state.checkpoint"],"components":["orchestrator","state-store"],"see_also":["EAS-03.04"],"section":"know-what-re-executes-on-resume"},{"id":"EAS-09.05","title":"Decisions recorded, not recomputed","level":"L2","applies":"All Workflows.","requirement":"Every ModelCall MUST execute in a construct whose result is recorded durably (an activity, task or checkpointed Step) and returned from the record on replay or resume. Recovery MUST read recorded Decisions and MUST NOT re-invoke the model for a Decision already made. Other nondeterministic inputs (external calls, random values, current time) MUST likewise be recorded.","rationale":"Decisions, once made, are facts: the model is asked once, its answer is recorded, and recovery reads the record. Calling a model directly from replayed workflow code would produce different decisions from the original Run.","evidence":{"static":"In replay-based engines, ModelCalls and other nondeterministic operations occur only inside activities, never in workflow code; in checkpoint-based frameworks, each Decision is part of the checkpointed state before any action based on it.","runtime":"In resumed Runs, no Step that completed before the resume has a ModelCall span after it (excluding explicit forks under EAS-09.06)."},"remediation":{"scope":"local","guidance":"Move ModelCalls into recorded activities or tasks, and persist each Decision in the Checkpoint before acting on it."},"hooks":["model.after","state.checkpoint"],"components":["orchestrator","state-store"],"section":"replay-without-recomputation"},{"id":"EAS-09.06","title":"Sandboxed replay and forking","level":"L2","applies":"Platforms that offer replay, forking or \"time travel\" from an earlier Checkpoint.","requirement":"In replay or fork mode, every Tool with `effect_class` other than `none` MUST be replaced by a recorded or sandboxed version, and no ActionIntent created in such a Run MUST reach the Executor against real systems. Replay mode MUST be enforced by the platform, not left to the operator.","rationale":"Forking from a past Checkpoint is extremely valuable for debugging and evaluation and dangerous if the branch can reach real systems; debugging an incident must never cause a second one.","evidence":{"static":"The replay or fork entry point sets a mode that the tool interception point or Executor reads, substituting recorded results or sandbox backends for effectful Tools; real credentials are not issued to forked Runs.","runtime":"No `eas.execute` span is linked to a Run in replay or fork mode.","attested":"When an engineer forks a production Run to debug it, what prevents the fork from sending a real message or making a real payment?"},"remediation":{"scope":"structural","guidance":"Make replay mode a property of the Run checked in `tool.before` and in the Executor, and route effectful Tools to recorded responses or sandbox backends in that mode."},"hooks":["state.resume","tool.before"],"components":["orchestrator","tool-gateway","executor"],"see_also":["EAS-03.10"],"section":"replay-without-recomputation"},{"id":"EAS-09.07","title":"Drain on deploy","level":"L2","applies":"All Workflows in production.","requirement":"On deploy, old workers MUST stop taking new work, finish the Step they are executing within a time limit, write its Checkpoint and exit. Runs MUST NOT be killed mid-Step by a deploy. New workers resume runnable work from Checkpoints.","rationale":"With durable state, deploys become manageable: paused Runs are on no worker and are unaffected, and in-flight Runs reach a Step boundary before their worker exits.","evidence":{"static":"Workers pull runnable work from a queue; shutdown handling stops pulling, waits for the current Step up to a configured timeout, checkpoints and exits; the deployment's termination grace period exceeds that timeout.","runtime":"No `eas.step` span is left unterminated or ends in error across a deploy; Runs active at deploy time reach a terminal status.","attested":"What is the drain timeout, and what happens to a Step still running when it expires?"},"remediation":{"scope":"local","guidance":"Handle the termination signal by stopping intake and finishing the current Step, and set the platform's grace period above the longest expected Step."},"hooks":["state.checkpoint"],"components":["scheduler","orchestrator","release-control"],"see_also":["EAS-05.14"],"section":"deploys-drain-dont-kill"},{"id":"EAS-09.08","title":"Version pinning","level":"L2","applies":"All Workflows whose Runs can outlive a deploy (waiting or long-running Runs).","requirement":"Each Run MUST record the Workflow version it started on, and every Checkpoint MUST be tagged with that version. The default strategy MUST be pin and drain: a Run resumes only on the version that started it, old versions remain deployed with workers able to run them until their last Run finishes or is cancelled, and new Runs start on the new version. Resuming on a different version is permitted only under EAS-09.09.","rationale":"Resuming on new code can break topology, state schema or, most insidiously, semantics, where nothing fails but the Run follows two designs. Pin and drain is the only approach that guarantees one consistent design from start to finish.","evidence":{"declared":"`workflows[].version` is set, and `state.version_strategy` includes `pin_and_drain` (or names `compatible_only` / `migrate` with EAS-09.09 evidence).","static":"The Run record and each Checkpoint store the Workflow version; resume routes to workers for that version; deployment keeps old versions running while Runs pinned to them exist.","runtime":"All spans of a Run carry the same `eas.workflow.version`, unless a migration under EAS-09.09 is recorded.","attested":"When a Run on the previous version resumes after a deploy, which code runs it?"},"remediation":{"scope":"structural","guidance":"Record the version at `run.start`, check it at `state.resume`, and use the engine's version-routing support (or versioned worker pools) so old versions keep running until drained."},"hooks":["run.start","state.resume"],"components":["orchestrator","scheduler","release-control","state-store"],"section":"versioning-when-code-changes-under-a-paused-run"},{"id":"EAS-09.09","title":"Compatible-change enforcement and tested migrations","level":"L3","applies":"Workflows that apply changes to in-flight Runs (strategy `compatible_only` or `migrate`).","requirement":"The platform MUST keep an inventory of where every paused Run is waiting, and CI MUST compare each change against it and block deploys that rename or remove any Step, state field or type a paused Run might touch. Changes applied in place MUST be additive. Breaking changes applied to in-flight Runs MUST use explicit migrations that transform the old version's state into the new one on resume, tested against real Checkpoints sampled from production with personal data removed.","rationale":"Additive changes are safe in place; renames and removals strand paused Runs. Migrations deserve the same discipline as event-schema migrations in a streaming system.","evidence":{"declared":"`state.version_strategy` lists `compatible_only` and/or `migrate`.","static":"A paused-Run inventory (Step and version per waiting Run) exists; a CI check diffs Workflow topology and state schema against it; migration code is versioned with tests that load sampled, redacted Checkpoints.","runtime":"Resumes that change `eas.workflow.version` correspond to a recorded migration.","attested":"Show the last deploy blocked by the paused-Run check, or the last migration and the Checkpoints it was tested against."},"remediation":{"scope":"structural","guidance":"Build the paused-Run inventory from the state store, add a CI gate against it, and run migrations in `state.resume` with tests over a redacted Checkpoint sample."},"hooks":["state.resume"],"components":["release-control","state-store","data-governance"],"see_also":["EAS-09.08","EAS-12.11"],"section":"versioning-when-code-changes-under-a-paused-run"},{"id":"EAS-09.10","title":"Checkpoint storage engineering","level":"L3","applies":"Platforms running Workflows at volume.","requirement":"Checkpoint storage MUST be capacity-planned as a workload. Large objects (documents, large tool results) MUST be stored in object storage and referenced from Checkpoints, not copied into them. The store MUST be sharded by Run. Checkpoints MUST have a retention policy: full while the Run is active and for a debugging window afterwards, then compacted to the final state, then deleted. Checkpoints MUST be included in the personal-data inventory and the deletion path.","rationale":"A Checkpoint can be tens or hundreds of kilobytes per Step, written at every Step of every Run; and it contains everything the agent saw, so it is a copy of personal data.","evidence":{"declared":"`state.checkpointer` names the store; retention periods are documented.","static":"Checkpoint serialisation replaces large payloads with object-storage references; the store is partitioned by Run; retention and compaction jobs exist; deletion fan-out includes the checkpoint store.","attested":"What is the checkpoint write volume and growth rate, and how long is a completed Run's full state kept?"},"remediation":{"scope":"structural","guidance":"Externalise large objects at the `state.checkpoint` hook, partition the store by Run, and schedule compaction and deletion according to the retention policy."},"hooks":["state.checkpoint"],"components":["state-store","data-governance"],"see_also":["EAS-12.07","EAS-12.09"],"section":"checkpoints-are-a-real-workload"},{"id":"EAS-09.11","title":"Fault-injection testing","level":"L3","applies":"All Workflows with effectful Tools or pause points.","requirement":"CI MUST kill workers at every Step boundary and at points inside Steps, resume the affected Runs, and assert that no side effect happened more than once and that the final state equals that of an uninterrupted Run. Before each deploy, a sample of real paused Checkpoints MUST be resumed on the candidate version, and the deploy MUST fail if any cannot continue.","rationale":"Confidence that durability, resumption and versioning work comes only from deliberately breaking them.","evidence":{"static":"A fault-injection test suite that terminates execution at and inside Step boundaries, with assertions on effect counts (for example via idempotency keys or a sandbox recorder) and final-state equality; a pre-deploy job that resumes sampled paused Checkpoints on the candidate version.","attested":"Show the most recent CI run of the fault-injection suite and the pre-deploy resume check."},"remediation":{"scope":"local","guidance":"Add a test harness that interrupts Runs at configurable points against sandboxed Tools, and a release gate that resumes a redacted sample of paused Checkpoints on the candidate."},"components":["release-control","eval-platform"],"see_also":["EAS-09.01","EAS-09.09"],"section":"testing-for-it"}]},
    {"domain":"EAS-10","order":10,"slug":"evidence-gated-change","title":"Evidence-Gated Change","essay":"10-evidence-gated-change","summary":"Every Change that can alter an agent's behaviour passes through a gate, and the gate is evidence: an EvalSuite designed well enough to detect the regressions that matter, followed by shadow and canary exposure, with a kill switch behind all of them.","controls":[{"id":"EAS-10.01","title":"All behaviour-altering changes versioned","level":"L1","applies":"All Workflows.","requirement":"Every Change that can alter agent behaviour (prompt, model, tool description, retrieval configuration, Workflow code, policy, EvalSuite dataset) MUST be made through version control and MUST produce a new Workflow version. Behaviour MUST NOT be alterable through edits in a vendor console or runtime configuration store that bypass version control. Every Run MUST record the Workflow version it executed.","rationale":"Prompt edits, model swaps, reworded tool descriptions and tuned retrieval settings can alter behaviour as much as a code change, yet they are often made in a configuration file or vendor console, checked on a few examples, and shipped without any gate.","evidence":{"declared":"`workflows[].version` is set and changes whenever any behaviour-altering artefact changes.","static":"Prompts, tool descriptions, model identifiers, retrieval parameters and policies live in the repository (or in a registry that pins each Workflow version to an immutable revision) and are loaded from there at runtime. Not satisfied by: prompts fetched by name from a prompt-management service or vendor console without a pinned revision; a floating model alias (for example `latest`) whose target can change without a Change; retrieval settings held only in a mutable environment or admin UI.","runtime":"Every `eas.run` span carries `eas.workflow.id` and `eas.workflow.version`, and every observed `eas.workflow.version` resolves to a revision in version control.","attested":"Can anyone change a prompt, model, tool description or retrieval setting in production without a commit? Produce the list of behaviour-altering artefacts and where each is versioned."},"remediation":{"scope":"local","guidance":"Move prompts, tool descriptions and retrieval configuration into the repository, pin model snapshots explicitly, derive the Workflow version from the commit, and remove write access to any console that can change production behaviour."},"components":["release-control"],"see_also":["EAS-10.07","EAS-09.08"],"section":"the-gates"},{"id":"EAS-10.02","title":"Kill switch","level":"L1","applies":"All Workflows in production.","requirement":"It MUST be possible to disable a Workflow, a specific Workflow version, or a specific tenant's use of a Workflow immediately, without a deploy. The switch MUST be checked before a Run is admitted and SHOULD be checked before each Step so that in-flight Runs stop at the next Step boundary.","rationale":"Behind every other gate sits the ability to stop a Workflow instantly. Most of the time it is never used; when it is needed, nothing else will do.","evidence":{"static":"A runtime flag or control-plane setting, keyed by Workflow, version and tenant, read at Run admission (a `run.start` hook or scheduler check). Not satisfied by: an environment variable or configuration file that takes effect only on redeploy; a switch that covers the whole Workflow but not individual versions or tenants.","runtime":"In a drill or real use, no new `eas.run` span with the disabled `eas.workflow.id` / `eas.workflow.version` / `eas.tenant.id` combination starts after the switch time.","attested":"Who can operate the kill switch, how long does it take to take effect, and when was it last exercised? Produce the runbook and the record of the most recent drill."},"remediation":{"scope":"local","guidance":"Add a flag lookup keyed by Workflow, version and tenant to Run admission and the Step loop; document the operating procedure and drill it."},"hooks":["run.start","model.before"],"components":["release-control","scheduler","orchestrator"],"see_also":["EAS-05.13","EAS-10.09"],"section":"the-gates"},{"id":"EAS-10.03","title":"Deliberate, versioned eval dataset","level":"L2","applies":"All Workflows.","requirement":"Each Workflow MUST have an EvalSuite whose dataset is assembled deliberately from: sampled production tasks with personal data removed; every incident and escalation converted into a case; adversarial cases; and synthetic cases for rare but important situations. The dataset MUST be stratified by the dimensions that matter (for example customer segment, task type, Workflow branch, difficulty) with results reported per stratum, and MUST be versioned so that comparisons between versions of the Workflow use the same dataset version.","rationale":"The evaluation must reflect the actual distribution of inputs rather than what engineers imagine; past failures should become permanent checks; and a regression on a rare stratum should show up as such rather than disappearing into an average.","evidence":{"declared":"`evaluation.suite` and `evaluation.dataset_version` are set for the Workflow.","static":"An eval dataset directory or registry entry with version history, case metadata recording source (`production_sample`, `incident`, `escalation`, `adversarial`, `synthetic`) and stratum, and a documented sampling and redaction procedure. Not satisfied by: a hand-written list of examples with no production sample; a dataset edited in place without a version; incidents fixed without a corresponding case.","attested":"How are production tasks sampled into the suite, and what is the process that turns an incident or escalation into a case? Produce the last three incident-derived cases and their dataset version."},"remediation":{"scope":"local","guidance":"Start a versioned dataset from a redacted production sample, add one case per historical incident and escalation, tag every case with source and stratum, and make incident review produce a case as a required output."},"components":["eval-platform"],"see_also":["EAS-07.08","EAS-12.11"],"section":"datasets-built-deliberately"},{"id":"EAS-10.04","title":"Outcome and trajectory evaluation","level":"L2","applies":"All Workflows at rung `fixed_workflow` and above.","requirement":"The EvalSuite MUST evaluate both outcomes (correctness, groundedness, policy compliance, well-formedness) and trajectories (Tools chosen, arguments passed, unnecessary calls, forbidden actions). It MUST report at least: task success rate, tool-call precision, groundedness and citation accuracy, policy violation rate, Steps and cost per task, latency to first useful action, and unrecoverable failure rate.","rationale":"The final answer is not the only thing worth checking: an agent that reaches the right answer with thirty tool calls where four would do has regressed, because it costs more, takes longer and has more chances to go wrong.","evidence":{"declared":"`evaluation.gates[]` names metrics covering both outcome and trajectory.","static":"Evaluators in the suite that inspect recorded tool calls and Step counts as well as final output. Not satisfied by: a suite that scores only the final response.","attested":"Produce the most recent evaluation report showing each listed metric for the current and previous Workflow version."},"remediation":{"scope":"local","guidance":"Record the trajectory of each eval Run from its Trace, and add evaluators for tool choice, argument correctness, call count and forbidden actions alongside the outcome checks."},"components":["eval-platform","telemetry-pipeline"],"section":"outcomes-and-trajectories"},{"id":"EAS-10.05","title":"Stated minimum detectable effect","level":"L2","applies":"All Workflows with an EvalSuite.","requirement":"Each EvalSuite MUST state its minimum detectable effect on each primary metric, computed from its size, design (independent or paired), the baseline rate, and stated false-alarm and power settings. Release decisions MUST NOT claim the absence of a regression smaller than the stated minimum detectable effect.","rationale":"Every suite has a smallest regression it can see; a fifty-case golden set can detect a collapse but not a five-point drop. Knowing the figure turns \"did the evaluation pass?\" into an honest statement of what the gate can catch.","evidence":{"declared":"`evaluation.mde` is set per primary metric.","static":"The calculation (or the script that produces it) is stored with the suite, including significance level, power, baseline rate and design. Not satisfied by: a suite size chosen without a calculation.","attested":"What is the smallest drop in task success your release gate will reliably detect, and how was that figure derived?"},"remediation":{"scope":"local","guidance":"Compute the minimum detectable effect from the current suite size; if it is larger than the regression you care about, enlarge the suite or move to a paired design (EAS-10.08)."},"components":["eval-platform"],"see_also":["EAS-10.08"],"section":"statistics-so-you-dont-chase-noise"},{"id":"EAS-10.06","title":"Calibrated judges","level":"L2","applies":"All EvalSuites that use a model as a judge.","requirement":"Criteria that code can check (schema conformance, cited source exists and supports the claim, recipient on an allowed list, required disclosure present) MUST be checked deterministically, not by a judge. Each model judge MUST be calibrated against human labels per criterion using a chance-corrected agreement statistic (for example Cohen's kappa), with verdicts on criteria of low agreement not used for gating. Known biases MUST be controlled: presentation order randomised in pairwise comparison, and length and same-family preference measured. A change to the judge model MUST trigger recalibration.","rationale":"A judge is a measuring instrument, not an oracle: it may agree with humans on accuracy and disagree badly on tone, it favours first positions, longer answers and its own model family, and a new judge is a new instrument.","evidence":{"static":"Stored human-labelled calibration set, per-criterion agreement results tied to the judge model and prompt version, order randomisation in pairwise judge code, and deterministic evaluators for checkable criteria. Not satisfied by: a single overall agreement figure; a judge used for schema or citation existence checks.","attested":"For each judged criterion, what is the current agreement with human labels, and when was the judge last recalibrated? Produce the calibration report."},"remediation":{"scope":"local","guidance":"Replace judge checks for anything code can verify; label a sample per criterion, compute kappa, and pin the judge model so that changing it is a Change that requires recalibration."},"components":["eval-platform"],"see_also":["EAS-04.03"],"section":"judges-calibrated"},{"id":"EAS-10.07","title":"CI evaluation gate","level":"L2","applies":"All Workflows.","requirement":"Every Change to a prompt, model, tool description or Workflow MUST run the EvalSuite in continuous integration. A statistically significant regression beyond a set threshold on a primary metric MUST block the Change. A regression on a secondary metric MUST require a written justification and a named person's sign-off. Suites SHOULD be tiered: a smoke suite on every Change, the full suite before merge to the main branch and before release, and an extended multi-sample suite on a schedule.","rationale":"Inspecting a handful of examples catches catastrophes and almost nothing else; a change that makes the agent slightly worse on a tenth of cases is invisible in a dozen hand-checked outputs and very visible in production a week later.","evidence":{"declared":"`evaluation.gates[]` lists primary and secondary metrics with thresholds.","static":"A CI workflow (for example under `.github/workflows/`) triggered by changes to prompts, model configuration, tool definitions and Workflow code that runs the suite and fails the build on a primary regression; a required status check on the main branch; a recorded sign-off mechanism for secondary regressions. Not satisfied by: an eval job that reports but cannot fail; path filters that exclude prompt or configuration files; a gate that compares against a threshold without a significance test.","attested":"Produce the most recent blocked Change and the most recent secondary-metric sign-off, with the named approver."},"remediation":{"scope":"local","guidance":"Add a CI job that runs the smoke suite on every relevant path, the full suite on merge, and fails on a significant primary regression; make it a required check."},"components":["eval-platform","release-control"],"see_also":["EAS-10.01","EAS-10.05"],"section":"the-gates"},{"id":"EAS-10.08","title":"Paired comparison designs","level":"L3","applies":"Workflows at risk tier `T3` or where the suite's minimum detectable effect is larger than the regression of concern.","requirement":"Comparisons between Workflow versions MUST run both versions on the same cases and compare them case by case, using a paired test (McNemar's test for pass/fail outcomes). For tasks with high run-to-run variance, each case MUST be sampled several times per version.","rationale":"Pairing removes the variation that comes from cases differing from one another and detects the same difference with considerably fewer cases; repeated sampling further reduces noise on variable tasks.","evidence":{"static":"Evaluation code that executes baseline and candidate on an identical case set and dataset version, applies a paired test, and supports a samples-per-case setting. Not satisfied by: comparing a candidate's score against a historical baseline score from an earlier run.","attested":"Produce the paired comparison output for the last release, including the test used and samples per case."},"remediation":{"scope":"local","guidance":"Re-run the current production version alongside every candidate on the same dataset version and replace unpaired threshold checks with McNemar's test."},"components":["eval-platform"],"see_also":["EAS-10.05"],"section":"statistics-so-you-dont-chase-noise"},{"id":"EAS-10.09","title":"Shadow and canary with automatic rollback","level":"L3","applies":"All Workflows at risk tier `T3`.","requirement":"Before full release, a new Workflow version MUST run in shadow on real traffic with side effects disabled, with its Decisions compared with the current version's and divergence reviewed. It MUST then receive a small share of real traffic as a canary, with errors, policy rejections, escalation rate and cost per Run monitored against thresholds, and an automatic rollback when any threshold is breached.","rationale":"Offline suites cannot capture everything real traffic does; shadow exposes divergence without consequence, and a canary limits the blast radius of what remains while a rollback acts faster than a person.","evidence":{"static":"Shadow mode in which the executor is disabled or replaced (no ActionIntent is executed); traffic-splitting configuration by Workflow version; rollback automation wired to canary alert rules. Not satisfied by: a canary watched manually with no automated rollback; shadow runs that can execute effects.","runtime":"Metrics by `eas.workflow.version` (`eas.run.status`, `eas.policy.decision = deny`, `escalate` decisions, `eas.cost.usd`) are available for the canary version; no `eas.execute` span exists for a Run executing in shadow.","attested":"Produce the shadow divergence review and canary record for the last release, and the most recent automatic rollback."},"remediation":{"scope":"structural","guidance":"Introduce version-aware traffic routing in release control, a shadow mode that disables the executor, and alert-driven rollback to the previous pinned version."},"components":["release-control","executor","telemetry-pipeline"],"see_also":["EAS-03.10","EAS-10.02","EAS-12.03","EAS-12.04"],"section":"the-gates"},{"id":"EAS-10.10","title":"Proxy validity checks","level":"L3","applies":"All Workflows whose release gates rely on offline proxies.","requirement":"The offline metrics used as release gates MUST be validated periodically against online business outcomes, by checking whether versions that score better on the proxies also produce better OutcomeEvents. A proxy that stops predicting the outcome MUST be removed from gating and the EvalSuite revised.","rationale":"An evaluation suite measures proxies; its value rests on the assumption that better proxy scores mean better outcomes, and that assumption breaks when the product, user behaviour or optimisation pressure changes.","evidence":{"attested":"When were offline scores last compared with online outcomes per Workflow version, and with what result? Produce the analysis and any resulting suite revision.","static":"A scheduled job or analysis joining evaluation results by Workflow version to outcome metrics from the outcome store."},"remediation":{"scope":"structural","guidance":"Join per-version evaluation scores with per-version outcome rates (EAS-11.05) on a fixed schedule and record the correlation; retire proxies that stop tracking."},"components":["eval-platform","outcome-store"],"see_also":["EAS-11.03","EAS-11.05"],"section":"offline-evidence-must-predict-online-outcomes"}]},
    {"domain":"EAS-11","order":11,"slug":"baseline","title":"Baseline Measurement","essay":"11-measure-against-the-right-baseline","summary":"The cost of a Workflow is measured per successful outcome, including every cost it actually incurs, as incremental lift where possible, and judged against the cheapest credible alternative rather than the most flattering one.","controls":[{"id":"EAS-11.01","title":"Written success definition per Workflow","level":"L2","applies":"All Workflows.","requirement":"Each Workflow MUST have a written definition of a successful outcome in business terms, specific enough that a Run (or the OutcomeEvents joined to it) can be classified as successful or not without judgement.","rationale":"A run that costs ten cents and is wrong is not cheaper than one that costs thirty and is right; the meaningful denominator is successful outcomes, which requires saying what success is.","evidence":{"declared":"`workflows[].success_definition` is set. Not satisfied by: a definition in activity terms (\"Run completed\", \"response sent\"), or one that cannot be evaluated from recorded data.","attested":"Which recorded fields or OutcomeEvents determine whether a Run of this Workflow succeeded?"},"remediation":{"scope":"local","guidance":"Write the definition with the business owner (for example \"ticket resolved without escalation and not reopened within 14 days\") and name the data that evaluates it."},"components":["outcome-store"],"see_also":["EAS-11.03"],"section":"cost-per-call-is-the-wrong-unit"},{"id":"EAS-11.02","title":"Complete cost attribution per Run","level":"L2","applies":"All Workflows.","requirement":"Cost MUST be attributed to each Run across all components: model tokens for every model used, tool and infrastructure costs (queries, search, state and trace storage), human time spent reviewing, approving and correcting the Run's work, and the cost of failed Runs and of work retried or redone by hand. Each Run MUST record its identifier, tenant, the entities it acted on, Workflow and version, and its cost components.","rationale":"Token cost is the most visible and often not the largest; human review time is frequently the biggest cost and the one nobody counts, so an agent cheap in tokens can cost more than the process it replaced.","evidence":{"static":"A per-Run cost record (in the outcome store or warehouse) keyed by Run identifier with separate components for model, tool/infrastructure and human time; approval and review tooling that records reviewer time against the Run. Not satisfied by: token cost alone; human review time estimated only in aggregate.","runtime":"Every model span carries `gen_ai.request.model`, `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens` and `eas.cost.usd`; every `eas.run` span carries `eas.run.id`, `eas.tenant.id`, `eas.workflow.id` and `eas.workflow.version`.","attested":"Produce the cost breakdown for a sample of Runs, including human review time and Runs that failed."},"remediation":{"scope":"structural","guidance":"Emit model cost per call, attribute metered tool and storage costs and reviewer time to `eas.run.id`, and record entity identifiers at `run.end` so outcomes can later be joined."},"hooks":["model.after","run.end"],"components":["telemetry-pipeline","outcome-store","approval-service"],"see_also":["EAS-05.04","EAS-12.03"],"section":"cost-per-call-is-the-wrong-unit"},{"id":"EAS-11.03","title":"Cost per successful outcome reported","level":"L2","applies":"All Workflows.","requirement":"For each Workflow and version, the number of Runs, their total cost, the number of successful outcomes and the cost per successful outcome MUST be reported, with uncertainty attached. Optimisation decisions (such as a model change) MUST be evaluated on cost per successful outcome, not on token cost alone.","rationale":"Cost per successful outcome connects engineering to business value, and shows why a model that costs half as much but succeeds less often can raise the real cost even as the token bill falls.","evidence":{"static":"A report or dashboard definition computing cost per successful outcome by Workflow and version from the per-Run cost and outcome data.","attested":"Produce the current cost per successful outcome for each production Workflow and version, with its confidence interval."},"remediation":{"scope":"local","guidance":"Join the per-Run cost record with the success definition and publish a table by Workflow and version."},"components":["outcome-store","telemetry-pipeline"],"see_also":["EAS-11.01","EAS-11.02","EAS-12.03"],"section":"cost-per-call-is-the-wrong-unit"},{"id":"EAS-11.04","title":"Declared cheapest credible baseline","level":"L2","applies":"All Workflows.","requirement":"Each Workflow MUST declare the baseline it is measured against: the cheapest credible alternative a sensible team would actually use if the agent did not exist (a rule, template, classifier or existing workflow). Value claims MUST be stated relative to that baseline. A comparison against the most expensive alternative (typically full human effort) MUST NOT be used as the primary justification unless that alternative is the one that would realistically be used.","rationale":"Comparing an agent to the salary of a person who would never have done the work flatters it; against the realistic alternative the question becomes sharp, and many agentic designs turn out to be beaten by simpler ones.","evidence":{"declared":"`workflows[].baseline` names the alternative process and its measured or estimated cost and success rate.","attested":"What would this team use if the agent did not exist, and how does the agent's cost per successful outcome compare with it? Produce the comparison."},"remediation":{"scope":"local","guidance":"Identify the simplest process that would be used instead, measure or estimate its cost and success rate, and report the agent against it."},"components":["outcome-store"],"see_also":["EAS-01.02","EAS-01.05"],"section":"choosing-the-baseline"},{"id":"EAS-11.05","title":"Late outcome attribution","level":"L3","applies":"Workflows whose success is determined by OutcomeEvents that arrive after the Run ends.","requirement":"OutcomeEvents MUST be captured from the systems where they happen, keyed by the same entities the Run recorded, and joined to Runs by a scheduled job within a declared attribution window. The job MUST recompute recent windows as late events arrive, and figures for a period MUST be marked provisional until its attribution window has closed.","rationale":"Real outcomes often arrive weeks after the agent acted; this is a familiar event-time join problem and must be handled as one rather than by counting only what is known at Run end.","evidence":{"static":"Event emission from source systems into the outcome store; a scheduled join with a configured attribution window and a recompute horizon; a provisional flag on reported figures. Not satisfied by: a one-off join at Run end; reports that present open-window figures as final.","attested":"What is the attribution window for each Workflow, and how are provisional figures marked in reports?"},"remediation":{"scope":"structural","guidance":"Emit OutcomeEvents keyed by entity from the systems of record, and run an event-time join that recomputes open windows and labels them provisional."},"hooks":["run.end"],"components":["outcome-store"],"see_also":["EAS-10.10","EAS-11.02"],"section":"outcomes-that-arrive-late"},{"id":"EAS-11.06","title":"Incremental lift","level":"L3","applies":"Workflows whose value is claimed as outcomes produced (for example meetings booked, tickets resolved).","requirement":"Value claims MUST be based on incremental outcomes, estimated by a holdout (a random share of eligible cases receiving the baseline treatment), a staggered rollout across comparable groups, or alternating treatment periods. Where none is possible, reported figures MUST be explicitly labelled as correlational and value claimed conservatively.","rationale":"Crediting the agent with every outcome overstates its value, because some would have happened anyway; lift is the difference between what happened with the agent and what would have happened without it.","evidence":{"static":"Holdout assignment logic (random, recorded per case) or a documented staggered-rollout design.","attested":"Produce the most recent lift estimate with holdout size and the cost per incremental outcome, or the report showing figures labelled as correlational."},"remediation":{"scope":"structural","guidance":"Introduce a small random holdout (for example 5–10%) that receives the declared baseline, record assignment per case, and report lift and cost per incremental outcome."},"components":["outcome-store","release-control"],"see_also":["EAS-11.04"],"section":"lift-not-totals"},{"id":"EAS-11.07","title":"Evaluated model routing","level":"L2","applies":"Workflows that route between models (cascades, fallbacks to cheaper models).","requirement":"Before routing goes live, the EvalSuite MUST establish that the smaller model's accepted answers are as good as the larger model's on the same cases and that the check deciding escalation is reliable. After launch, the escalation rate MUST be monitored, with an alert when it drifts from the evaluated rate.","rationale":"A cascade can save most of the model bill, but only if the cheap model's accepted answers are as good and the escalation check is reliable; a rising escalation rate means inputs have shifted and the economics with them.","evidence":{"static":"Routing configuration under version control, an evaluation run that compares the cascade with the large model alone, and an alert rule on escalation rate. Not satisfied by: routing chosen on cost alone.","runtime":"The share of Runs with a ModelCall to the larger model (`gen_ai.request.model`) is derivable per Workflow version and stays within the alert threshold.","attested":"Produce the evaluation that justified the routing configuration and the current escalation rate."},"remediation":{"scope":"local","guidance":"Gate routing changes through the EvalSuite like any other Change and add an escalation-rate alert to the Workflow's metrics."},"hooks":["model.before"],"components":["model-gateway","eval-platform"],"see_also":["EAS-10.07","EAS-11.03"],"section":"where-the-savings-actually-come-from"}]},
    {"domain":"EAS-12","order":12,"slug":"observability","title":"Governed Observability","essay":"12-observability-data-is-sensitive-data","summary":"Agent Traces are designed twice: once to be useful for debugging, evaluation, cost and audit, and once to be governed as the copy of customer data they are, with redaction before export, controlled access, and deletion that reaches every copy.","controls":[{"id":"EAS-12.01","title":"Structured trace tree with common schema","level":"L1","applies":"All Workflows.","requirement":"Every Run MUST emit a Trace structured as a tree (Run, Steps, and the ModelCalls and ToolCalls beneath the Step that made them) using the EAS telemetry conventions. Run spans MUST carry Run identifier, tenant, Workflow and version; ModelCall spans model, token counts, latency and cost; ToolCall spans Tool, result size and error; PolicyDecisions MUST be recorded at each boundary.","rationale":"A privacy-safe trace that cannot diagnose anything protects nobody, and a common schema is what makes cross-Workflow questions answerable without bespoke work.","evidence":{"declared":"`observability.exporter` names an OpenTelemetry-compatible exporter.","static":"Instrumentation that creates `eas.run`, `eas.step`, model and `execute_tool` spans with parent-child relationships. Not satisfied by: flat logs per call; per-team attribute names that differ from the conventions.","runtime":"Every `eas.run` span carries `eas.run.id`, `eas.tenant.id`, `eas.workflow.id` and `eas.workflow.version`; every model span is a descendant of an `eas.step` and carries `gen_ai.request.model`, `gen_ai.usage.input_tokens`, `gen_ai.usage.output_tokens` and `eas.cost.usd`; every `execute_tool` span carries `gen_ai.tool.name` and `eas.tool.output_tokens`."},"remediation":{"scope":"local","guidance":"Adopt the framework's OpenTelemetry GenAI instrumentation and add the `eas.*` attributes in a shared span processor rather than per Tool."},"hooks":["run.start","model.after","tool.after","run.end"],"components":["telemetry-pipeline"],"section":"what-to-capture"},{"id":"EAS-12.02","title":"No unredacted personal data exported","level":"L1","applies":"All Workflows that handle personal data.","requirement":"Personal data (names, email addresses, phone numbers, account identifiers, free-text fields likely to contain them) MUST NOT leave the agent's process in telemetry. Either redaction MUST run in-process before export, or payload capture MUST be disabled.","rationale":"Traces are a copy of everything the agent touched, and are usually stored with far less care than the systems they were copied from; the most effective control is to reduce what they contain before they leave the process.","evidence":{"declared":"`observability.redaction` is set, or `observability.payload_capture` is disabled.","static":"A redaction span processor registered ahead of the exporter in the agent process. Not satisfied by: redaction configured in the downstream collector or tracing vendor; framework defaults that capture prompts and completions with no processor in place.","runtime":"No exported span has `eas.payload.captured = true` without `eas.redaction.applied = true` and an `eas.redaction.policy` value; principals' personal identifiers never appear in clear text in any attribute."},"remediation":{"scope":"local","guidance":"Disable payload capture immediately; then add an in-process redaction processor before the exporter and re-enable capture per EAS-12.04."},"components":["telemetry-pipeline"],"see_also":["EAS-12.05"],"section":"redact-before-anything-leaves-the-process"},{"id":"EAS-12.03","title":"Metrics by version","level":"L2","applies":"All Workflows.","requirement":"Metrics MUST be derived from Traces and broken down by Workflow, tenant and version: reliability (share of Runs succeeding, failing unrecoverably or stuck; latency to first useful output and to completion; queue wait time), production quality signals (policy rejections, escalations, user corrections or retries, grounding-check failures) and cost (tokens and currency per Run and per successful outcome). Cost anomalies MUST raise alerts.","rationale":"Breaking every metric down by version is what makes regressions attributable; without it a bad release shows up as a vague deterioration nobody can pin on a cause.","evidence":{"static":"Dashboard and alert definitions grouped by `eas.workflow.version`, covering each metric family.","runtime":"Distributions of `eas.run.status`, counts of `eas.policy.decision` by value, and sums of `eas.cost.usd` are derivable per `eas.workflow.id`, `eas.workflow.version` and `eas.tenant.id`.","attested":"Produce the dashboard showing the current and previous version side by side, and the cost anomaly alert rule."},"remediation":{"scope":"local","guidance":"Build the metric set from span attributes with version as a mandatory dimension, and add anomaly alerts on cost per Run."},"components":["telemetry-pipeline"],"see_also":["EAS-10.09","EAS-11.03","EAS-05.13"],"section":"what-to-capture"},{"id":"EAS-12.04","title":"Tiered payload capture","level":"L2","applies":"All Workflows.","requirement":"Metadata (timings, token counts, models, Tools called, outcomes, costs) MUST be retained for every Run. Full payloads MUST be retained selectively: for every error, policy rejection, escalation, Run on a canary version, and user-flagged Run, plus a random sample of all other Runs. Recent Traces SHOULD be held in an interactive tool with short retention and the remainder archived in governed storage the organisation controls, partitioned by tenant and date.","rationale":"Full payloads at production volume are very large and expensive in volume-priced tools; tiering keeps the small metadata that supports aggregate analysis and the payloads that matter, with a random sample so analysis is not biased towards failures.","evidence":{"declared":"`observability.payload_capture` is `tiered` and `observability.payload_sample_rate` is set.","static":"A sampling or capture policy in the telemetry pipeline keyed on error, policy, escalation, canary and flag conditions plus a random rate.","runtime":"Every span with `eas.payload.captured = true` carries an `eas.payload.capture_reason`; every `eas.policy` span with `eas.policy.decision` of `deny` or `escalate` belongs to a Run with captured payloads; some captured Runs have reason `sample`."},"remediation":{"scope":"local","guidance":"Make the capture decision at Run end from its status and decisions, and archive captured payloads in tenant- and date-partitioned storage."},"hooks":["run.end"],"components":["telemetry-pipeline"],"see_also":["EAS-12.02","EAS-12.08"],"section":"estimate-the-volume-before-choosing-the-tools"},{"id":"EAS-12.05","title":"Tokenised redaction with a vault","level":"L2","applies":"All Workflows that capture payloads containing personal data.","requirement":"Redaction MUST replace personal data with tokens referring to entries in a secure vault, so that the tracing system receives only tokens. Re-identification MUST go through a controlled process that records who looked and why.","rationale":"Engineers can see the structure of what happened without the real values; and deleting a person's vault entries makes every token referring to them meaningless, wherever the Trace has been copied.","evidence":{"static":"The redaction processor calls a vault to tokenise detected values; vault access controls and an audit log for detokenisation. Not satisfied by: irreversible masking only (acceptable for EAS-12.02 but not this control); a vault whose detokenisation is not audited.","attested":"Produce the detokenisation audit log for the last month and the procedure for requesting a real value."},"remediation":{"scope":"structural","guidance":"Introduce a PII vault with consistent tokens per value and route all re-identification through an audited request flow."},"components":["pii-vault","telemetry-pipeline"],"see_also":["EAS-12.02","EAS-12.09"],"section":"redact-before-anything-leaves-the-process"},{"id":"EAS-12.06","title":"Trace access governed like customer data","level":"L2","applies":"All Workflows.","requirement":"Access to Traces MUST be restricted to the team that owns the Workflow. Cross-tenant access MUST be restricted and logged. Access for investigating a specific customer's issue MUST be time-limited, granted for that purpose and revoked afterwards.","rationale":"Traces are copies of customer data, so the access rules that would be unremarkable for a production database apply; they need stating because they are unusual for an observability stack.","evidence":{"static":"Access-control configuration of the tracing backend and archive scoped by Workflow owner and tenant; a just-in-time access mechanism with expiry.","attested":"Who can read Traces for this Workflow today, and how is time-limited support access granted and revoked? Produce the access log for a recent grant."},"remediation":{"scope":"structural","guidance":"Scope tracing projects or datasets per Workflow owner, partition by tenant, and replace standing broad access with expiring grants."},"components":["telemetry-pipeline","data-governance"],"section":"access-to-traces-is-access-to-customer-data"},{"id":"EAS-12.07","title":"Data inventory covers all copies","level":"L2","applies":"All Workflows that handle personal data.","requirement":"An inventory MUST list every store that holds data derived from Runs: Traces, Checkpoints, memory, search and vector indexes, eval datasets, prompt and response caches, the model provider's retention, and ad-hoc copies (notebooks, tickets, local files). Each entry MUST state what it holds, its retention, and how deletion reaches it.","rationale":"Agent systems copy data into many places, and the right to deletion does not exempt logs; the most often forgotten copies are the ones engineers paste while debugging.","evidence":{"static":"A data inventory document or catalogue entry per Workflow covering each store category.","attested":"Produce the inventory. What is the model provider's retention for this Workflow, and what policy governs pasting Traces into tickets and notebooks?"},"remediation":{"scope":"local","guidance":"Enumerate stores from the manifest (`state`, `memory`, `context.sources`, `observability`, `evaluation`) plus provider terms and ad-hoc copies, and assign an owner to each."},"components":["data-governance"],"see_also":["EAS-12.09"],"section":"deletion-has-to-reach-traces-too"},{"id":"EAS-12.08","title":"Records tagged with tenant and data subjects; retention per tier","level":"L2","applies":"All Workflows that handle personal data.","requirement":"Every record in a store holding Run-derived data MUST be labelled with its tenant and the data subjects it concerns at write time, so deletion is a lookup rather than a search. Each storage tier MUST have a defined retention period, and records SHOULD hold references instead of copies where possible.","rationale":"Tagging at write turns deletion into a lookup, and minimising what is stored, with short retention for interactive tools, reduces what must be found and removed.","evidence":{"declared":"`observability.retention_days` (interactive tier) and `observability.archive_retention_days` are set.","static":"Write paths for traces, Checkpoints, memory and indexes attach tenant and data-subject tags (as tokens, not clear values); retention or lifecycle policies configured on each store. Not satisfied by: tenant tags without data-subject tags; retention configured on the tracing tool but not the archive.","runtime":"Every exported span carries `eas.tenant.id`."},"remediation":{"scope":"local","guidance":"Add tenant and subject tags in shared write paths (span processor, `state.checkpoint` and `memory.write` hooks) and set lifecycle rules on every store."},"hooks":["state.checkpoint","memory.write"],"components":["telemetry-pipeline","state-store","memory-store","data-governance"],"see_also":["EAS-12.07","EAS-12.09"],"section":"deletion-has-to-reach-traces-too"},{"id":"EAS-12.09","title":"Tracked, verified deletion","level":"L3","applies":"All Workflows that handle personal data under deletion obligations.","requirement":"A deletion request MUST create a tracked job that fans out to every store in the inventory, confirms the data is gone by checking for it, and records evidence that it did. Stores that delete eventually rather than immediately MUST have the delay known, documented and within legal limits.","rationale":"Deletion must reach traces and every other copy; a fan-out that is not verified cannot show that it did, and eventual deletion in some table formats leaves rows in older files until compaction runs.","evidence":{"static":"A deletion service or job definition that enumerates inventory stores, performs a post-deletion lookup, and writes a completion record.","attested":"Produce the record of a recent deletion request showing each store, the verification result and the timestamp, and the documented delays for eventually-deleting stores."},"remediation":{"scope":"structural","guidance":"Build deletion as a workflow over the inventory with per-store delete-and-verify steps; deleting vault entries (EAS-12.05) covers tokenised copies."},"components":["data-governance","pii-vault"],"see_also":["EAS-12.05","EAS-12.07","EAS-12.08"],"section":"deletion-has-to-reach-traces-too"},{"id":"EAS-12.10","title":"Per-tenant encryption keys","level":"L3","applies":"Multi-tenant platforms holding sensitive Run-derived data.","requirement":"Sensitive fields in stores holding Run-derived data MUST be encrypted with keys held per tenant, so that removing a tenant can be done by destroying its key.","rationale":"Data copied into many stores is hard to delete exhaustively; destroying a tenant's key renders every copy encrypted under it unreadable.","evidence":{"static":"Key-management configuration with a key per tenant and field-level or envelope encryption in Trace archive, state, memory and index write paths.","attested":"What is the procedure for destroying a tenant's key, and which stores does it cover?"},"remediation":{"scope":"structural","guidance":"Introduce envelope encryption with per-tenant data keys in the shared write paths for each store."},"components":["data-governance","state-store","memory-store","telemetry-pipeline"],"see_also":["EAS-12.09"],"section":"deletion-has-to-reach-traces-too"},{"id":"EAS-12.11","title":"Privacy-safe eval datasets","level":"L2","applies":"All EvalSuites built from production data.","requirement":"Eval datasets built from production Traces SHOULD be made from redacted or synthetic versions of real cases, with personal details replaced by consistent placeholders. Where real data is retained, each case MUST be tagged with its data subjects so it can be removed, and a removal MUST be recorded as a dataset version change.","rationale":"Eval datasets are deliberately permanent and built from production Traces, so they need to remain useful without containing anyone's data, and removing a case changes the baseline.","evidence":{"static":"Dataset build pipeline applies the redaction policy; case metadata carries a `contains_personal_data` flag and subject tags for any unredacted case. Not satisfied by: raw Trace payloads copied into eval files.","attested":"How many cases in the current dataset contain real personal data, and how would one be removed on request?"},"remediation":{"scope":"local","guidance":"Run dataset construction through the same tokenising redaction as Traces, with consistent placeholders, and bump the dataset version on any removal."},"components":["eval-platform","data-governance"],"see_also":["EAS-10.03","EAS-12.07"],"section":"deletion-has-to-reach-traces-too"}]}
  ]
}
