Skip to content
On this page

Security

A consolidated view of what the protocol proves, what it does not prove, the trust assumptions it relies on, and the threat model it targets. For the detailed threat treatment see the upstream SECURITY.md (opens in a new tab).

GuaranteesLink to this section

A full verification of an agent-action A against its cited delegation D establishes:

Check cleanGuarantee
E_BAD_SIG on DHolder of D.principal.address's key at issued_at authorized this delegation.
E_REVOKED absentNo revocation is in effect now, and none predates the action's signed-at (modulo OTS anchoring).
E_STALE absentThe action was signed within the verifier's bound of now (live verification).
E_BAD_ACTION_STAMP cleanHolder of D.agent.address's key at A.signed_at authorized this action.
E_SCOPE_DENIED absentThe exercised scope is a legal narrowing of a granted scope.
E_BOND_UNVERIFIED absentThe principal's declared bond is still staked on-chain.
A.ots confirmed + verifiedAction's envelope id existed before the declared Bitcoin block.

What OC Agent does NOT proveLink to this section

  • That the agent actually performed the declared action. A stamped agent-action proves "the agent's key signed a commitment to X." Whether X happened in the real world — the HTTP request was sent, the invoice was paid, the post was published — is a downstream question. Observers MAY match the action's content.hash to downstream artifacts to confirm.
  • That the action was in the principal's interest. Scope containment is necessary, not sufficient. The bond is what puts reputational cost on the principal's choice to delegate.
  • Confidentiality of the grant or the action content. Wrap in OC Lock (opens in a new tab) to the intended recipient when confidentiality is needed.
  • Agent key rotation. A compromised agent key requires a new delegation to a new agent address plus revocation of the old delegation. Prior actions remain signed by the original key.
  • Sender anonymity. All addresses are plaintext.
  • Post-quantum authenticity. secp256k1 breaks under a cryptographically relevant quantum adversary. No PQ layer in v1.
  • On-chain enforcement of the bond. The bond is a publicly auditable reputational signal, not escrow.

Threat model (summary)Link to this section

#ThreatMitigation
T1Forged delegationBIP-322 under principal's key
T2Forged agent-actionBIP-322 under agent's key
T3Scope escalationDeterministic sub-scope algorithm
T4Wrong-agent actionagent.address ↔ signer.address equality check
T5Use after expiryLive verification checks the delegation at now, whatever signed_at says
T6Replay across delegationsdelegation_id is a hash; unique per delegation
T7Revocation censorshipPublish to ≥3 diverse relays; absence counts only from the relays that answer
T8Revocation forgeryBIP-322 under the principal or the agent; any other signer is refused
T9Priority manipulationLive: a revocation in effect refuses every action, and signed_at is bound to the verifier's clock. Audit: OTS anchoring
T9aRepeated actionA verifier that acts on actions acts on each action id once
T10Bond misrepresentationAttestation re-resolution against current chain state
T11Unregistered scope confusionStrict mode rejects unknown; permissive never inflates to wildcard
T12Scope-key confusionStrict mode rejects unknown keys; permissive accepts them and they still bind
T13Malicious relayAuthenticity is BIP-322 in envelope; relays cannot forge

Trust assumptionsLink to this section

  • secp256k1 signatures remain unforgeable at current parameter sizes.
  • BIP-322 is implemented correctly by signing and verifying clients across address types.
  • SHA-256 collision resistance holds.
  • OpenTimestamps calendars do not backdate (required only if anchoring is used).
  • Bitcoin block headers are available to the verifier.
  • Nostr relays have at-least-one-honest availability (publish to ≥3 diverse relays).
  • Wallet UI faithfully renders the canonical message being signed.

Implementation requirementsLink to this section

Compliant implementations MUST:

  1. Reject envelopes whose v is unknown.
  2. Reconstruct the canonical message byte-for-byte from envelope fields and compare the hash to the declared id before trusting any field.
  3. Verify the BIP-322 signature before evaluating scopes, bonds, or any semantically-weighted field.
  4. Reject envelopes with unknown scope products or verbs in strict mode; in permissive mode, accept them and apply every constraint as written.
  5. Compute the sub-scope relation deterministically.
  6. Cross-reference A.delegation_id with D.id, A.signer.address with D.agent.address, A.signed_at with D's window. When the result decides whether to act, verify live: the delegation and every link at now, signed_at within the verifier's bound of its clock, and each action id used once.
  7. Query revocation feeds (kind 30085, #t with the cited delegation_id) unless the caller opts out. A relay that rejected the query, closed it or timed out has not answered; if none answered, revocation is unchecked, not clean.
  8. Re-resolve bond.attestation_id against current chain state when bond policy is in effect.
  9. Produce the error codes in §SPEC 11.

SHOULD:

  • Anchor high-stakes actions and revocations to OpenTimestamps.
  • Publish delegations to ≥3 diverse Nostr relays.
  • Wrap sensitive delegations in OC Lock.
  • Render scope strings in canonical form before asking the user to sign.

Reporting vulnerabilitiesLink to this section

Private security advisory on oc-agent-protocol (opens in a new tab) or email security@ochk.io. Do not file vulnerabilities as public issues.

Known limitationsLink to this section

v1 explicitly defers: on-chain bond slashing, privacy-preserving encrypted scopes with public verifiability, per-action bond increments, and post-quantum hybrid signatures. Sub-delegation shipped in v1.1 (sub-delegation) and encrypted scopes for named recipients in v1.2 (private scope). M-of-N federation principals are specified in v1.2 (FEDERATION.md (opens in a new tab)), and agent-core verifies them with verifyFederationDelegation; agent-signer has no helper to build one. Each is a spec-level addition that composes with v1 rather than breaking it.