Contextfulv0.23.0

Docs / Guides

contract authority · 50-authority.md · 51-enforcement.md · guide · card

Authority and enforcement

The problem authority solves

A caller reads stored rows on behalf of a person, and the store holds rows that person may not see. Admission verifies the caller’s credential. A checkpoint is the code in a command, server or gateway that performs admission and produces the verified permissions every read and write takes (admitted-authority). Enforcement applies those permissions to each read, deciding which rows and cells the caller receives.

Flowchart diagram Flowchart, top to bottom. 9 nodes, 9 edges. identity provider → token exchange [verified assertion] issuer: token exchange → credential [signed credential] holder: credential → narrower child [append a block]; → signature and caveats hold? [presented] holder: narrower child → signature and caveats hold? [presented] checkpoint: signature and caveats hold? → admitted authority [yes]; → rejected request [no] admitted authority → registered relation [grants] enforcement: registered relation → read surfaces [admitted rows] issuer token exchange holder append a block credential narrower child checkpoint signature and caveats hold? enforcement registered relation verified assertion signed credential presented presented yes no grants admitted rows identity provider admitted authority rejected request read surfaces

What a credential says

A subject is a tuple of agent, host, principal, task, zone and incognito flag (subject-tuple). The mint verifies only the principal, against the identity provider (on-behalf-of).

The credential is a chain-signed token under a versioned profile that names every fact the engine admits (delegation-profile). Its grants name actions, table patterns and optional tenant, template and aggregate bounds (fields).

Getting a credential

The example reader signs into the console. The console holds no project-wide credential; it exchanges the reader’s identity assertion for that reader’s short-lived credential (per-reader). The policy maps the reader’s role to read on workspace/*, and the assertion’s tenant claim becomes the tenant scope acme-eu on every grant (tenant).

A direct mint, outside the exchange, needs a credential whose grant carries admin (unauthorized-mint).

Narrowing for a sub-agent

The reader’s agent spawns a sub-agent. A holder derives a narrower child offline by appending a signed block, with no issuer round trip (offline). The agent derives one child per sub-agent, bound to that sub-agent’s own key pair (per-sub-agent). A derivation that adds write fails, naming the widened dimension (widens).

A horizon on a grant bounds the availability time of every read its holder makes (horizon).

Flowchart diagram Flowchart, top to bottom. 8 nodes, 8 edges. holder: horizon credential → sub-agent child [same or earlier horizon]; → read tools [inherited availability bound]; → pre-send hook [horizon] holder: sub-agent child → read tools [inherited availability bound] read face: read tools → store tables [bounded read] connector: pre-send hook → host is the model endpoint? [outbound intent] connector: host is the model endpoint? → model endpoint [yes]; → refused hop [no] connector: refused hop holder same or earlier horizon horizon credential sub-agent child read face read tools connector outbound intent no pre-send hook host is the model endpoint? refused hop inherited availability bound inherited availability bound bounded read horizon yes store tables model endpoint

Admission

A checkpoint holds public keys only, so admitting a request calls no outside service (public-key-only). Each request under a key-bound credential carries a proof signed by the matching private key (possession-binding).

Each statement start and each commit re-reads expiry, revocation and policy version (effect-boundary). Short lifetimes are the primary withdrawal (short-lifetime).

An operator adds the sub-agent’s derivation to the denylist every checkpoint reads (denylist). At its next effect boundary the sub-agent’s credential fails (revoked). The parent credential carries its own revocation identifier and keeps working (revocation-id).

Enforcement in three layers

Enforcement is three layers: removal at write time, a redistribution bound at push, and row and column restriction at query time (compose).

Write-time redaction drops or transforms a value before columnar bytes exist (write-time). It is the only layer protecting data at rest; a column protected at query time alone is cleartext in storage. A cleared redistribution flag withholds the whole table from the bucket at push (withhold).

The sub-agent queries workspace/documents with no tenant filter. The engine conjoins a byte-exact tenant equality the query text omits (tenant-equality). A statement naming acme-us fails, naming both scopes (scope-denied). A refusal returns a typed error, not an empty result (not-empty).

A contact_email column masked by policy arrives masked where it stands (in-place). The table declares no zone policy, so it resolves to a fail-closed pair of zones (fail-closed). The response envelope reports the zone’s removals and carries no removed value (envelope).

Every step completes before the engine cuts a ranked result to size, so visible positions carry no trace of a withheld row (before-the-cut).

Injected instructions

Text read from a source sometimes holds instructions aimed at the model. An organization-wide face serves only the read tools, and the server authors every conversational write (read-only-face). A claim write holding a credential-shaped value fails before storage (credential-shaped-value).