$ fssg build --deterministic --validate |

FACET Policy as Executable Authorization

FACET

Agent security is often described as a model-behavior problem. Ask the model to be careful. Put a policy in the system prompt. Add a reviewer after the tool call has already been proposed.

That sequence is backwards.

Authorization is not prose the model should remember. It is a decision the execution boundary must make. FACET v2.1.3 makes that distinction concrete: policy is compiled into the contract, evaluated by a fail-closed runtime guard, and recorded as provenance. The model may propose an effect. It never grants itself the authority to perform one.

This article has one job: explain the authorization path as an executable artifact. It is not another general argument for contracts or determinism. The narrow question is: what must happen between a model proposing a tool call and the system allowing the side effect?

A permission string is not a security model

A tool schema answers a structural question: what arguments does this function accept? It does not answer an authority question: may this principal invoke it, against this resource, in this phase, with this effect?

The difference matters. A perfectly typed delete(path) call can still be forbidden. Valid JSON is not authorization. A successful schema validator only proves that the request has the expected shape.

This is why prompt-level rules are weak boundaries. They participate in generation, while authorization must govern execution. The model can summarize a policy, misunderstand it, or be induced to disregard it. None of those outcomes should change the runtime decision.

FACET's current specification describes @policy, capability and effect classes, a fail-closed Runtime Guard, policy-semantics versioning, and a provenance artifact with a hash chain. Together they form something more useful than a list of allowed tools: a portable authorization program.

The decision tuple

A practical guard can be understood as evaluating a tuple:

DECIDE(
  principal,
  capability,
  resource,
  effect,
  phase,
  constraints,
  policy_version,
  contract_hash
) -> permit | deny

Each field closes a different ambiguity.

  • Principal identifies who or what is acting. “The agent” is too vague when a workflow contains planners, workers, reviewers, and adapters.
  • Capability names the authority being requested, not merely the function exposed.
  • Resource scopes that authority to a path, service, repository, tenant, or other bounded target.
  • Effect distinguishes observation from mutation, external communication, privilege change, or irreversible action.
  • Phase prevents authority granted for one stage from leaking into another.
  • Constraints carry limits such as path patterns, budgets, argument predicates, or approval requirements.
  • Policy version fixes the semantics used to interpret the rule.
  • Contract hash binds the decision to the exact compiled artifact.

This tuple is my engineering interpretation of the repository's policy machinery, not a claim that every runtime exposes this exact function signature. The important property is that the decision inputs are explicit and replayable.

Capabilities describe authority; effects describe consequence

Tool allowlists collapse two different dimensions. A tool name says what interface is reachable. It says little about what a particular invocation will do.

Consider a filesystem tool. read_file and write_file are easy to classify, but real tools are rarely so clean. A package command can inspect metadata, download code, alter a lockfile, execute lifecycle scripts, or publish a release. The tool identity stays constant while the effect changes.

A stronger contract therefore asks two questions:

  1. What capability is required? For example, repo.read, repo.modify, or release.publish.
  2. What effect class does this invocation produce? Read-only, bounded mutation, network egress, secret access, or irreversible external action.

This creates a useful asymmetry: capabilities are granted; effects are classified and constrained. A principal may hold repo.modify inside a workspace and still be denied an invocation whose resolved effect includes network publication.

That separation is the core mechanism. It prevents “has access to the tool” from silently becoming “may perform every behavior reachable through the tool.”

Compile policy before inference

FACET flips the order of operations. The .facet document is parsed into an AST, checked, and emitted as canonical JSON before execution. Policy belongs in that compilation path.

A simplified pipeline looks like this:

.facet source
  -> parse
  -> resolve names and capabilities
  -> type-check policy predicates
  -> reject contradictions or unknown semantics
  -> emit canonical policy IR
  -> hash contract
  -> begin model execution

Compile-time rejection is valuable because ambiguity cannot be delegated to the model. An unknown capability, an unsupported policy_version, or an invalid resource selector should stop the run before tokens are spent and before a provider payload exists.

Canonical JSON then gives policy a stable intermediate representation. Stable representation matters for review, caching, diffing, signatures, and replay. If two equivalent source documents compile to the same canonical artifact, the authorization boundary can reason about the artifact rather than formatting accidents.

This extends the argument in Canonical JSON as the real AI interface: an intermediate representation is not only a provider adapter. It is also where authority becomes inspectable.

Fail closed at the last responsible moment

Compilation cannot know every runtime fact. A resource may resolve differently, an approval may expire, or an adapter may discover an additional effect. The guard must therefore evaluate again immediately before execution.

The safe sequence is:

model proposes call
  -> normalize call
  -> resolve resource and effect
  -> evaluate compiled policy
  -> bind approval to contract + call hash
  -> permit or deny
  -> execute only on permit
  -> append provenance record

“Fail closed” means that missing facts do not become permission. Unknown capability: deny. Unsupported policy semantics: deny. Resource resolution failure: deny. Approval referring to a different call hash: deny.

This is deliberately stricter than post-hoc validation. A validator can report that an unsafe action happened. A guard prevents the action from crossing the boundary.

The design also complements Why I want recoverable agents, not autonomous ones. Recovery protects state after interruption or failure; authorization controls whether a proposed effect may enter state at all. They solve adjacent but distinct problems.

Provenance turns permission into evidence

A permit decision without a receipt is difficult to audit. The runtime should preserve a compact provenance record:

{
  "contract_hash": "sha256:...",
  "policy_version": "...",
  "principal": "worker:docs",
  "capability": "repo.modify",
  "resource": "src/en/posts/example.md",
  "effect": "bounded-write",
  "decision": "permit",
  "approval_hash": null,
  "previous_record_hash": "sha256:..."
}

The FACET standard describes a provenance artifact with hash-chain support. A chain does not make records true by magic, but it makes deletion, insertion, and reordering detectable when the chain head is anchored appropriately. That is a precise benefit; it is not the same as claiming a complete tamper-proof audit system.

Provenance connects three moments that are often separated: what was compiled, what was authorized, and what was executed. It also gives testing a concrete target. A policy regression suite can assert not only deny, but the reason, semantics version, resolved effect, and artifact hash.

Boundary conditions

Executable policy is not a universal security solution.

First, effect classification is only as good as the adapter. If a shell adapter labels an arbitrary command as read-only, the formal policy preserves a false premise. Adapters must conservatively report effects and resources.

Second, a runtime guard cannot contain authority it does not control. If the process already has unrestricted filesystem credentials, bypass paths remain possible. OS sandboxing, scoped credentials, network controls, and least-privilege deployment still matter. This is where FACET can align with established capability-security thinking rather than replace it.

Third, provenance needs protected storage and an anchoring strategy. A hash chain stored beside a fully compromised runtime may be replaced wholesale.

Finally, policy semantics must evolve carefully. Versioning is not metadata decoration. A runtime that does not understand the declared version must reject the contract rather than guess.

These limits are part of the model. Formalization is useful because it reveals where the trusted computing base actually sits: compiler, policy evaluator, adapters, credential boundary, and provenance store.

The contract should own the verb

The model can choose a sentence. It can propose a plan. It can request a capability.

But the verb that changes the world—write, send, delete, charge, deploy—must belong to the execution system.

That is the deeper value of FACET policy. It moves safety from remembered instructions to an executable authorization path: compiled semantics, explicit capabilities, classified effects, fail-closed decisions, and evidence after every boundary crossing.

The future of agent security will not be a more persuasive paragraph at the top of a prompt. It will look like a compiler error before inference, a denial before side effect, and a receipt after permission.

That is not the model behaving well. That is the system retaining authority.

Sources: FACET standard and specification, FACET compiler, and the NIST AI Risk Management Framework.

FACET AI CLI Terminal
facet@ai:~$