Records and Validation
ADS Records
Directory uses Open Agent Schema Framework (OASF) which defines a standardized schema for representing agents and their capabilities using OASF Record specification. This ensures interoperability and consistency across different implementations of the directory service.
Content Identifier
The content identifier of the record is a Content IDentifier (CID) hash digest which makes it:
- Globally unique
- Content-addressable
- Collision-resistant
- Immutable
Names and Ownership
Records must include a name field. A name such as example.com/agent lets a record be referenced as name, name:version or name:version@cid instead of by CID. A name is a label chosen by the publisher and is not verified. Who stands behind a record is asserted separately, with signed identity and ownership claims that the reconciler verifies against the key material their subject publishes.
See Identity and Ownership Claims for the claim schema and verification, Usage Guide — Identity and Ownership Claims for the workflow and the CLI Reference for the commands.
Example Email Agent
You can generate your own example records using the OASF Record Sample generator. Below is an example OASF record for an email agent that is capable of sending and receiving emails.
{
"schema_version": "1.0.0",
"name": "cisco.com/agents/email-agent",
"version": "v1.0.0",
"authors": ["Cisco Systems Inc."],
"description": "An agent that can send and receive emails.",
"created_at": "2025-08-11T16:20:37.159072Z",
"annotations": {
"agntcy.dir/owner": "dns:cisco.com"
},
"skills": [
{
"id": 10306,
"name": "natural_language_processing/information_retrieval_synthesis/information_retrieval_synthesis_search"
},
{
"id": 10202,
"name": "natural_language_processing/natural_language_generation/summarization"
},
{
"id": 60103,
"name": "retrieval_augmented_generation/retrieval_of_information/document_retrieval"
}
],
"locators": [
{
"urls": [
"https://github.com/agntcy/agentic-apps/tree/main/email_reviewer"
],
"type": "source_code"
},
{
"urls": [
"https://github.com/agntcy/agentic-apps/tree/main/email_reviewer/pyproject.toml"
],
"type": "package"
}
]
}
Note
The record can be pulled with the reference cisco.com/agents/email-agent:v1.0.0 instead of its CID. The agntcy.dir/owner annotation only declares the owner the record claims, dns:cisco.com. It counts as verified once a signed ownership claim for that subject checks out against the key published at _agntcy-key.cisco.com. See Identity and Ownership Claims.
Validation
The Directory enforces validation on all records before accepting them. Validation is performed using the OASF SDK, which requires an OASF schema server URL for validation.
Configuration
The Directory server validates records using policy.operations in YAML. Each entry selects a provider, the operations it applies to (push, autosync, index, pull, search), a name, that provider's settings, and optionally a mode. An empty list disables record validation. This list cannot be set via environment variables.
# server.config.yml
listen_address: "0.0.0.0:8888"
policy:
dir: "/etc/agntcy/dir/policies"
operations:
- provider: oasf
op: ["push", "autosync", "index"]
name: schema
schema_url: "https://schema.oasf.outshift.com"
- provider: opa
op: ["push"]
file: "require-annotations.rego"
opa loads a single .rego file from policy.dir. Helm mounts those files from the top-level policies map. The query is <package>.allow; a deny rejects the record. Its name defaults to the file's name without .rego.
A second block, policy.evaluations, holds the policies that do not check records on their way in. The reconciler evaluates every record against each one and stores a verdict, and the server can refuse to serve the records that fail. They have no operation and no mode, because they never act, and only opa and cel can define one. See Content Policy Enforcement.
Note
The Go server binary does not set a default validator list in code.
Deployment tooling provides defaults: Docker Compose, the dirctl daemon,
and Helm charts enable the official OASF schema URL on push, autosync, and index
unless overridden.
What a Policy Can Read
A policy in policy.operations decides one operation, so it is given the record and the circumstances of that operation, and nothing it would have to look up. oasf reads the record only. cel reads these variables:
| Variable | Type | Value |
|---|---|---|
record |
dynamic | The record's OASF content, read by field name. |
record_cid |
string | The record's content identifier. |
context.operation |
enum | Which operation is being decided: Operation.OPERATION_PUSH, Operation.OPERATION_AUTOSYNC, Operation.OPERATION_INDEX or Operation.OPERATION_PULL. A policy at search reads neither context nor now, because it is compiled into a query rather than run on an operation. |
context.source_peer_id |
optional string | The authenticated peer the record is being pulled from. Set at autosync and absent at push and index, so a policy covering more than one operation tests it with has(context.source_peer_id) before comparing it. |
now |
timestamp | The instant the operation is being decided at, the same one for every policy deciding it. |
indexed_at |
optional timestamp | When this node first indexed the record. Set at index when the record already has a row; absent at index for a record seen for the first time, and absent at push and autosync, which decide from the record alone without reading the row. Absent rather than the zero time, so a policy unwraps it with orValue or tests it with hasValue(). |
- provider: cel
op: ["push", "autosync"]
name: synced-records-are-locatable
expressions:
- 'context.operation != Operation.OPERATION_AUTOSYNC || has(record.locators)'
indexed_at is the one variable here that not every operation can answer, which is why it is optional. push and autosync decide from the record alone and do not read its row, so they leave it absent even for a record that has been indexed before; index reads the row before writing one, and so answers it for a record it has seen before. Because it is optional it has to be unwrapped before it is compared: indexed_at.orValue(now) < now - duration('168h') is an age condition that treats a record with no index time yet as not old enough, and indexed_at < now - duration('168h') does not load at all, since an optional timestamp has no comparison with a timestamp. The age condition is what prune is for — a row the reconciler has already selected — and prune does not decide through a policy yet.
opa is given the same values as its input document: input.record.name, input.record_cid, input.context.operation, input.context.source_peer_id, input.now, input.indexed_at, and input.verdicts at pull. Two differences follow from the document being JSON. An enum arrives as its name, so the comparison is input.context.operation == "OPERATION_PUSH" rather than a number. An unset source_peer_id or indexed_at is absent from the document rather than empty, so a policy tests it with not input.context.source_peer_id or input.indexed_at. now is an RFC 3339 string, and so is indexed_at.
A policy in this block cannot read meta, the facts about a record that an evaluation policy reads. Those belong to policy.evaluations, which runs per record rather than per operation; see Content Policy Enforcement. A cel policy here that names one does not load, and the node reports it at startup rather than letting the policy decide on nothing.
At pull
A policy at pull decides whether to serve a record that is already stored, so it reads what this node has concluded about that record rather than the record itself:
| Variable | Type | Value |
|---|---|---|
verdicts |
map | Each evaluation policy's conclusion, keyed by policy ID. |
| Verdict field | Type | Value |
|---|---|---|
compliant_and_current |
bool | Whether the record satisfies the policy and the verdict was reached under the version in force. This is the field to decide on. A missing, failed, superseded or non-compliant verdict all read false. |
status |
enum | How far the evaluation got: VerdictStatus.VERDICT_STATUS_UNEVALUATED, _EVALUATED, _FAILED or _SUPERSEDED. |
compliant |
bool | Whether the condition was satisfied, whatever version reached that conclusion. Read as "satisfies this condition", not as "this record is good". |
policy_version |
string | The version the verdict was reached under. Informational; decide on compliant_and_current. |
reason |
string | Why the evaluator decided as it did, or why it failed. |
evaluated_at |
optional timestamp | When the verdict was reached. Absent when there is none. |
- provider: cel
op: ["pull"]
name: serve-checked-records
expressions:
- 'verdicts["cel:trusted"].compliant_and_current'
A policy at pull cannot read record. A read by CID is decided before the content is fetched, which is what keeps a lookup an index read, so there is no record there to give it. A policy that reads one does not load, and the node says so at startup rather than letting it decide on an empty record. This applies to oasf too, which is nothing but a reading of record content.
The restriction costs less than it looks. A record's content cannot change under its CID, so a question about content has one answer forever: ask it in policy.evaluations, which sees the whole record, is answered once per record, and leaves a verdict to read here.
Reading verdicts is the other way around: only pull and search have them. Every other operation decides before any verdict exists, so a policy naming verdicts at push, autosync or index does not load either.
At search
A policy at search decides which records a query returns. It reads the same verdicts map as pull and, like pull, cannot read record:
- provider: cel
op: ["search"]
name: serve-checked-records
expressions:
- 'verdicts["cel:trusted"].compliant_and_current'
Everything else about it follows from one fact: a search policy is never evaluated. Every other policy is handed a record and asked about it, but a search has no record to be asked about — the decision has to be known before any row is selected, or the node would have to read the whole index to return one page. So a search policy is compiled into the query instead, and the only expressions it accepts are the ones that can be compiled:
one verdict's compliant_and_current, and those combined with && and ||, nested freely.
verdicts["cel:trusted"].compliant_and_current
verdicts["a"].compliant_and_current && verdicts["b"].compliant_and_current
verdicts["a"].compliant_and_current && (verdicts["b"].compliant_and_current || verdicts["c"].compliant_and_current)
Everything else is refused when the policy is loaded, and the node names the expression it could not take. That includes negation (!), the other verdict fields (status, compliant, reason, policy_version, evaluated_at), record_cid, now, context, comparisons, constants, has(), and anything that iterates. Several of these could be compiled, and may be later; they are refused now because a refusal at startup costs an operator one error message, while a widening that turns out to mean something different in SQL than it did in CEL costs them records they never decided to hide.
Negation is the one worth understanding rather than just avoiding. The gate requires a positive verdict rather than excluding negative ones, so a record nobody has evaluated yet is already excluded. !verdicts["x"].compliant_and_current reads naturally as "records that failed x", but it would also match every record not yet evaluated, every record whose verdict was superseded by a metadata change, and every record whose evaluation errored — which is the opposite of a policy that hides unsafe records. Write the condition you want served, not the one you want hidden.
search accepts cel only
opa cannot be used at search, and the node refuses the configuration at startup. The compilable subset is small enough that a Rego policy here would be a .rego file forbidden from using almost any Rego: no not, no comprehensions, no helper rules, no built-ins. Supporting it would mean maintaining a second frontend whose only legal programs are a transliteration of the CEL ones. An opa policy at any other operation is unaffected.
A search policy is enforced only once every evaluation policy it reads has verdicts covering all indexed records, the same backfill latch as elsewhere. Unlike the flat policy list, the terms of a search policy cannot be dropped one at a time while they wait: dropping a term from a && would serve records the policy excludes, and dropping one from a || would hide records it allows. There is no safe direction, so the whole policy waits.
Modes
Each entry carries an optional mode, which decides what happens to its refusals. It applies to that entry alone, so one policy can be tried out while the others keep enforcing.
| Mode | What it does |
|---|---|
enforce |
Refuses the record. This is the default: an entry with no mode enforces. |
shadow |
Decides and logs the decision, but does not refuse the record. |
off |
Does not run the policy at all. |
shadow is how a policy is introduced to a running node: it reports what it would refuse, against real traffic, without turning away a record anyone depended on being accepted.
- provider: cel
op: ["push"]
name: annotations-are-required
mode: shadow
expressions:
- 'has(record.annotations)'
The Decision Log
An operation policy stores nothing, so the log is the only trace a decision leaves. Each policy that runs writes one line, under the policy component:
level=INFO msg="Operation policy refused the record" component=policy
operation=OPERATION_PUSH cid=baeareid5t7... policy_id=cel:annotations-are-required
mode=enforce decision=refuse reason="[ERROR: record has no annotations]"
A refusal is logged at INFO and an accepted record at DEBUG, since every record pushed, synced or indexed produces one of the latter. peer names the peer a record was synced from, and caller the authenticated identity of a push; each appears only where it is known.
decision is always what the policy decided, and mode says what was done about it. A line reading decision=refuse mode=shadow is a record that was accepted — reported by the message Shadow mode: operation policy would have refused the record — and counting those is how a shadow policy is assessed before it is switched to enforce.
A policy at search writes no line. It is never run on a record, so there is no per-record decision to log; one query would produce a line per row it did not return. What it excludes is reported as a count instead, by dir_policy_gate_search_records_excluded, and the records themselves can be listed through the audit service.
The Prometheus counters under dir_policy_gate_* are not this. They aggregate reads the evaluation layer excludes, carrying no CID and no policy ID; see Content Policy Enforcement.
Validation Behavior
The Directory server uses API-based validation against the configured OASF schema server:
- Validation Method: HTTP requests to the OASF schema server API.
- Errors vs Warnings: Only errors cause validation to fail. Warnings are returned but do not affect the validation result.
- Schema Version Detection: The schema version is automatically detected from each record's
schema_versionfield. - Supported Versions: The OASF SDK decoder supports specific schema versions (currently: 0.7.0, 0.8.0, and 1.0.0). Records using unsupported versions are not validated.
- Unknown Classes: Classes (such as modules, skills, and domains) not defined in the OASF schema are rejected with an error. Records must only use classes that are defined in the configured OASF schema instance.
OASF Instance Configurations
While there is only one validation method (API validation), you can configure the Directory server to use different OASF instances. The choice of OASF instance affects which records are accepted and how compatible your directory instance is with other directory instances.
The following table shows which OASF instance configurations can exchange records with each other:
| Instance Type | Can Pull From | Can Be Pulled By |
|---|---|---|
| Official OASF Instance | Official OASF instance only | Official OASF instance and custom instances with additional taxonomy |
| Custom OASF Instance (Additional Taxonomy) | Official OASF instance, custom instances with same extended taxonomy | Custom instances with same extended taxonomy only |
| Custom OASF Instance (Changed Taxonomy) | Custom instances with same changed taxonomy only | Custom instances with same changed taxonomy only |
Official OASF Instance
Using the official OASF instance (https://schema.oasf.outshift.com) provides the baseline for the official network.
Records validated here form the most strict, compatible set.
Configuration:
policy:
operations:
- provider: oasf
op: ["push", "autosync", "index"]
name: schema
schema_url: "https://schema.oasf.outshift.com"
Custom OASF Instance (Additional Taxonomy)
Using a custom OASF instance with extensions that add to the taxonomy (with modules, skills, and domains that extend the official taxonomy but doesn't change or remove).
Records using the extended taxonomy can only be pulled by nodes using the exact same extended taxonomy.
Configuration:
policy:
operations:
- provider: oasf
op: ["push", "autosync", "index"]
name: schema
schema_url: "https://your-custom-oasf-instance.com"
Custom OASF Instance (Changed Taxonomy)
Using a custom OASF instance with extensions that modify the taxonomy (with modules, skills, and domains that change or remove from the official taxonomy).
This approach is completely incompatible with all other options, can only work with nodes using the exact same changed taxonomy.
Configuration:
policy:
operations:
- provider: oasf
op: ["push", "autosync", "index"]
name: schema
schema_url: "https://your-custom-oasf-instance.com"
Deploying a Local OASF Instance
You can deploy a local OASF instance alongside the Directory server for testing or development purposes.
Testing with Local OASF Server
To test with a local OASF instance deployed alongside the directory server:
-
Enable OASF in Helm values
Edit
install/charts/dir/values.yamlwith the following configuration:apiserver: oasf: enabled: true -
Set schema URL to use the deployed OASF instance
In the same file, set the schema URL to use the deployed OASF instance:
apiserver: config: policy: operations: - provider: oasf op: ["push", "autosync", "index"] name: schema schema_url: "http://dir-ingress-controller.dir-server.svc.cluster.local"Replace
dirwith your Helm release name anddir-serverwith your namespace if different. -
Deploy the Directory chart with OASF enabled
Follow Kubernetes Deployment to create a Kind cluster and install the Directory Helm chart with the OASF subchart enabled in your
values.yaml.
The OASF instance is deployed as a subchart in the same namespace and automatically configured for multi-version routing via ingress.
Using a Local OASF Schema
The OASF subchart runs one oasf-server image for every schema version and mounts each version's schema from a ghcr.io/agntcy/oasf-schema:<version> image.
To serve a schema that is not released yet (e.g., 1.2.0-dev from a checkout of agntcy/oasf), build it as an oasf-schema image and load the image into Kind before deploying.
Recreating the Kind cluster after loading the image will discard it, so create the cluster once and deploy with Helm.
Follow the steps below:
-
Create the Kind cluster
kind create cluster --name agntcy-cluster task buildBuild Directory images before deploying. See Kubernetes Deployment for the full SPIRE and Helm setup.
-
Build the schema image from your OASF checkout
cd /path/to/oasf task build:schema SCHEMA_IMAGE_TAG=1.2.0-dev -
Load the schema image into Kind
kind load docker-image ghcr.io/agntcy/oasf-schema:1.2.0-dev --name agntcy-cluster -
Configure
values.yamlto serve the local schema:apiserver: oasf: enabled: true schema: versions: - schema: 1.2.0-dev default: true -
Deploy the Directory
Deploy with Helm without recreating the cluster:
helm upgrade --install dir ./install/charts/dir \ -f ./install/charts/dir/values.yaml \ -n dir-server --create-namespace
Note
If you rebuild the schema image, reload it into Kind and restart the deployment:
kind load docker-image ghcr.io/agntcy/oasf-schema:1.2.0-dev --name agntcy-cluster
kubectl rollout restart deployment/dir-oasf-1-2-0-dev -n dir-server
Related Documentation
For more information, see the following:
- OASF Validation Service - Detailed validation service documentation
- Validation Comparison - Comparison between API validator and JSON Schema
- OASF Extensions - Information about creating OASF extensions