Skip to main content
An ontology decides every call with Cedar policies that you write in the project. The same policies govern agents, people, and spaces. Tilde validates every policy at build time, against a schema generated from your objects, views, and handlers. Access is deny by default. A call runs only if a policy permits it and no policy forbids it.

Write a policy

policy(id, cedar…) holds exactly one permit or forbid. Interpolate handlers, views, objects, and properties, and Tilde writes the Cedar names for you.
ontology/policies.ts
List them in ontology({ policies }).

Principals

Each call carries a subject, and the actors acting for it. The subject and every actor must each be allowed. An agent never exceeds the person it acts for, and the person never exceeds the agent. Use these in conditions:

Resources and actions

context.input is the handler’s input, typed from its zod schema.

Field masking

A caller sees a property only with readField on it. Otherwise the value is null wherever a handler loads it, in output fields tagged with prop(), and inside handler SQL. Grant readField broadly, and forbid the sensitive properties.

Edits

Each edit an action makes is checked on its own. Edits are permitted by default, so only a forbid refuses one. The notes-for-people policy above stops agents changing internal notes through any action.

Approvals

An action can require a person’s approval. Permit it only when context.approved is true. A caller who is otherwise allowed then gets pending approval, and the input waits for a decision.
Nobody in the requester’s own chain can approve their request. Approvals expire after seven days. Tilde checks the requester’s policies again when the request is approved.

Audit

Tilde audits every decision, with the policies that decided it, and every finished action with its input and result. Values that carry one of the environment’s secrets are never recorded.