EAS-04 Enforcement Outside the Model
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.
| ID | Control | Level | Fix |
|---|---|---|---|
| EAS-04.01 | Prompt rules have code backstops | L1 | local |
| EAS-04.02 | Policy gate on every ToolRequest | L1 | local |
| EAS-04.03 | Deterministic output checks | L2 | local |
| EAS-04.04 | Policy as code | L2 | local |
| EAS-04.05 | Decision logging with rule id | L2 | local |
| EAS-04.06 | Lowest-layer enforcement | L3 | structural |
EAS-04.01 Prompt rules have code backstops L1
Applies to: All Workflows.
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.
Why: 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. Essay →
- Declared
- Each such rule appears in
policies[]with anenforced_atthat includes at least one ofgateway,output,data_layerornetwork. A policy whoseenforced_atis onlypromptand 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.policyspans carrying its rule identifier ineas.policy.rule_idoccur 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 local: 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
EAS-04.02 Policy gate on every ToolRequest L1
Applies to: All Workflows that expose Tools to the model.
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.
Why: 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. Essay →
- Declared
tools[].required_scopesandtools[].approvalare set for every Tool;policies[]entries withenforced_at: gatewaycover argument bounds for consequential Tools.- Static
- A blocking
tool.beforehook 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_toolspan is preceded, within the same Step, by aneas.policyspan witheas.policy.point = gatewayfor that ToolRequest; noexecute_toolspan follows aneas.policyspan whose decision isdeny.
Remediation local: 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
EAS-04.03 Deterministic output checks L2
Applies to: Workflows that send, publish or hand over model-drafted content to people or external systems.
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.
Why: 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. Essay →
- Declared
policies[]entries withenforced_at: outputfor 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
alloworescalate. - Runtime
- Every
execute_toolspan witheas.tool.egress = truethat carries drafted content is preceded by aneas.policyspan witheas.policy.point = output.
Remediation local: 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
EAS-04.04 Policy as code L2
Applies to: All Workflows.
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.
Why: Guardrails are critical code and deserve the same discipline. Policy tests guarantee that wrong proposals cannot become wrong actions without an expensive, nondeterministic evaluation. Essay →
- Declared
policies[].code_refandpolicies[].tests_refset 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 local: 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
EAS-04.05 Decision logging with rule id L2
Applies to: All Workflows.
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.
Why: 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. Essay →
- Static
- The policy gate and output checks emit a structured record for every decision, not only for denials.
- Runtime
- Every
eas.policyspan carries non-emptyeas.policy.decision,eas.policy.rule_idandeas.policy.point.
Remediation local: 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
EAS-04.06 Lowest-layer enforcement L3
Applies to: Workflows with data_access of private or regulated, or with egress-capable Tools.
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.
Why: 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. Essay →
- Declared
policies[]entries for data visibility, tenant isolation and egress haveenforced_atincludingdata_layerornetwork.- 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.policyspans witheas.policy.point = data_layerornetworkappear for denied cross-tenant or off-allowlist requests.- Attested
- If a Tool omitted its permission filter, what would the data store return?
Remediation structural: 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