Agent identity bugs are rarely dramatic at first. They look like small mismatches.
The agent updates the wrong account because the CRM customer and billing customer share an email address. It files a case note as the service account instead of the delegated operator. It remembers a preference from one tenant and recalls it in another. It calls a tool with broad platform credentials because nobody modeled the difference between “the user asked” and “the agent is allowed.”
These are not prompt problems. They are identity-layer problems.
The Identity Layer is the Intelligence-plane contract that tells the rest of ContextOS what an entity is, who the human actor is, which workload is acting, and which credentials may be exchanged at each boundary.
October 16 contract revision: identity examples below distinguish canonical partial RunContext fields from application-owned entity metadata. Typed claims identify an asserted actor; trusted current verification, finite grants, native risk and exact approval determine whether an action may proceed.
Entity identity: what the run is about
Most enterprise data has many identifiers for the same thing. A customer has a CRM id, billing id, support id, marketing id, and maybe several email addresses. A dataset has a catalog id, storage path, warehouse table, and owner label. A policy has a document slug, version id, effective date, and exception list.
ContextOS uses canonical entity IDs, or CEIDs, to keep those references stable across runs. This subject-binding JSON is an application-owned example, not a new top-level RunContext field:
{
"subject_ids": [
{
"type": "customer",
"ceid": "ceid_customer_8f4a",
"source_refs": [
"crm:contact_881",
"billing:acct_4409"
]
},
{
"type": "order",
"ceid": "ceid_order_19ac",
"source_refs": [
"orders:ord_991"
]
}
]
}The agent does not get to decide that two records are the same because the names look similar. Entity resolution is a governed service with confidence, provenance, collision handling, and human review for risky merges.
Actor identity: who delegated authority
A human request does not authorize every downstream action. The canonical partial RunContext example keeps tenant_id at run level, singular role and the actual UserDelegation fields:
{
"tenant_id": "tenant_acme_prod",
"user": {
"user_id": "usr_204",
"role": "support_manager",
"delegation": {
"auth_type": "oidc",
"subject": "usr_204",
"scopes": ["support.refund.review"],
"token_ref": "vault:delegation/usr_204"
}
}
}This is not a complete RunContext or an authority grant. The compatible ExecutionContractEnvelope attachment names exact control/profile definitions. Exported AuthorityGrant/AuthorityValidationInput require trusted current identity/owner/tenant/audience, finite purpose/resources/destinations/argument limits, full grant-digest observations, validity and every ancestor’s restrictions/revocation. A legacy scope string or optional identity signature cannot substitute for those checks.
Workload identity: which agent is acting
The agent also needs its own identity. That identity should answer:
- which agent definition is running,
- which version produced the plan,
- which runtime or deployment executed it,
- which service account or workload identity is eligible for token exchange,
- which owner is accountable for the workload.
{
"agent": {
"agent_id": "support_refund_agent",
"agent_urn": "agent:contextos/support-refund@2026.05.14",
"workload_identity": "spiffe://contextos/agents/support-refund",
"role": "support_platform",
"lifecycle": "active"
}
}Without workload identity, every incident collapses into “the agent did it.” That is not enough for access review, rollback, or audit.
Credential exchange belongs at the tool boundary
The JSON above is the canonical agent field only. A claim saying active is not a current lifecycle observation. Runtime/release/owner facts need verified bindings outside these display strings.
The agent should not hold broad credentials. The Tool Gateway should exchange typed identity claims for a least-privilege credential scoped to the current tool call.
A credential is neither business approval nor proof of active isolation. Bind the full exact ActionBinding, evidence and immutable pins to current entitled stored approval/quorum, then enforce actual sandbox/credential/data controls and preconditions before dispatch. Applicable policy-expression errors stop compilation with a structured error.
This is the difference between “the agent has access to payments” and “this run, on behalf of this user, under this policy decision, may call payments.issue_refund for this transaction and amount.”
The identity checks that catch real failures
| Failure | Identity-layer control |
|---|---|
| Wrong customer updated | CEID collision checks and source-ref proof. |
| Cross-tenant memory recall | memory records bound to tenant, subject, consent, and classification. |
| Agent overuses user authority | delegation scope and expiry checked at every gateway call. |
| Service account becomes universal key | workload identity mapped to narrow capability scopes. |
| Audit cannot name the actor | DecisionRecord stores user delegation, workload identity, approver, and trace. |
| Semantic drift in metrics | SIDs version business definitions separately from raw table names. |
Identity is not a login screen. It is a join discipline across the whole runtime.
Memory depends on identity
Promotion-aware memory is only safe when every memory candidate answers four questions:
| Question | Example |
|---|---|
| Who or what is this about? | ceid_customer_8f4a, ceid_dataset_revenue_daily. |
| Who observed or approved it? | delegated user, reviewer, system source. |
| Where may it be recalled? | tenant, domain, data class, consent scope. |
| When does it expire or require review? | TTL, contradiction status, policy version. |
A memory record without identity is just a sticky note with production privileges. It may be useful, but it should not enter compiled context.
Identity checks apply before candidate capture and across collection, inference, tool input/output, telemetry, cache, memory, export and delegation. Inventory derived copies, eligible readers/purposes/actual processors and retention; correction/deletion requires copy-specific receipts, not merely a revoked lookup result.
Product implication: identity is a user experience
Identity controls should surface in product moments. An approval request should show which user delegated authority, which agent is acting, which subject IDs are affected, and which credential scope will be minted. A trace review screen should group incidents by agent version and workload identity. A memory review queue should show the CEID and the consent scope before promotion.
This is not bureaucracy. It is how the operator develops trust in a system that can act.
Scheduled personal/proactive work and child agents retain current owned mandates, every ancestor restriction, protected atomic ownership and enforced generation fencing. Wake/resume rechecks current controls and remaining original shared capacity. Unknown external operations keep stable identity and reservations until provider-specific reconciliation; token rotation, cancellation or release rollback does not prove reversal or verified stop. Exact profiles and conformance need current independent useful/denial/fault evidence for the actual workflow/release/environment.
Readiness checklist
- Every
RunContextcarriestenant_id, delegated user identity, agent workload identity, and trace id. - Every material business entity has a CEID, source refs, confidence, and collision policy.
- Every ML-facing or semantic feature has a versioned SID or equivalent semantic identifier.
- Tool calls exchange credentials at execution time through the Gateway.
- Memory candidates carry subject identity, source, consent, classification, TTL, and contradiction state.
- DecisionRecords store actor, agent, subject ids, approvals, and policy decisions.
Research base
- ContextOS spec: Identity Layer, Governance, Memory Model, and API Contracts.
- W3C Trace Context for portable trace identity across services.
- OWASP Top 10 for LLM Applications for the risk categories that make excessive agency, data exposure, and tool misuse identity problems as much as model problems.
