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 clean | Guarantee |
|---|---|
E_ on D | Holder of D.'s key at issued_ authorized this delegation. |
E_ absent | No revocation is in effect now, and none predates the action's signed-at (modulo OTS anchoring). |
E_ absent | The action was signed within the verifier's bound of now (live verification). |
E_ clean | Holder of D.'s key at A. authorized this action. |
E_ absent | The exercised scope is a legal narrowing of a granted scope. |
E_ absent | The principal's declared bond is still staked on-chain. |
A. confirmed + verified | Action'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.hashto 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
| # | Threat | Mitigation |
|---|---|---|
| T1 | Forged delegation | BIP-322 under principal's key |
| T2 | Forged agent-action | BIP-322 under agent's key |
| T3 | Scope escalation | Deterministic sub-scope algorithm |
| T4 | Wrong-agent action | agent. ↔ signer. equality check |
| T5 | Use after expiry | Live verification checks the delegation at now, whatever signed_ says |
| T6 | Replay across delegations | delegation_ is a hash; unique per delegation |
| T7 | Revocation censorship | Publish to ≥3 diverse relays; absence counts only from the relays that answer |
| T8 | Revocation forgery | BIP-322 under the principal or the agent; any other signer is refused |
| T9 | Priority manipulation | Live: a revocation in effect refuses every action, and signed_ is bound to the verifier's clock. Audit: OTS anchoring |
| T9a | Repeated action | A verifier that acts on actions acts on each action id once |
| T10 | Bond misrepresentation | Attestation re-resolution against current chain state |
| T11 | Unregistered scope confusion | Strict mode rejects unknown; permissive never inflates to wildcard |
| T12 | Scope-key confusion | Strict mode rejects unknown keys; permissive accepts them and they still bind |
| T13 | Malicious relay | Authenticity 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:
- Reject envelopes whose
vis unknown. - Reconstruct the canonical message byte-for-byte from envelope fields and compare the hash to the declared id before trusting any field.
- Verify the BIP-322 signature before evaluating scopes, bonds, or any semantically-weighted field.
- Reject envelopes with unknown scope products or verbs in strict mode; in permissive mode, accept them and apply every constraint as written.
- Compute the sub-scope relation deterministically.
- Cross-reference
A.delegation_idwithD.id,A.signer.addresswithD.agent.address,A.signed_atwithD's window. When the result decides whether to act, verify live: the delegation and every link at now,signed_atwithin the verifier's bound of its clock, and each action id used once. - Query revocation feeds (kind 30085,
#twith the citeddelegation_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. - Re-resolve
bond.attestation_idagainst current chain state when bond policy is in effect. - 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.