Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.26.9']
go-version: ['1.26.11']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.26.9'
go-version: '1.26.11'
- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: Audit Go dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
working-directory: python
run: |
pip install --upgrade pip pip-audit
pip-audit --progress-spinner off
pip-audit --progress-spinner off .
119 changes: 117 additions & 2 deletions AGENTPIN_TECHNICAL_SPECIFICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@
- [15. Privacy Considerations](#15-privacy-considerations)
- [16. IANA Considerations](#16-iana-considerations)
- [17. Conformance Requirements](#17-conformance-requirements)
- [18. Future Work](#18-future-work)
- [18. Web Bot Auth Binding (v0.4)](#18-web-bot-auth-binding-v04)
- [19. Future Work](#19-future-work)
- [Appendix A: JSON Schema Definitions](#appendix-a-json-schema-definitions)
- [Appendix B: Example Implementations](#appendix-b-example-implementations)
- [Appendix C: Relationship to Existing Standards](#appendix-c-relationship-to-existing-standards)
Expand Down Expand Up @@ -343,6 +344,7 @@ The discovery document is a JSON object with the following top-level structure:
| `policy_url` | string | OPTIONAL | URL of a human-readable policy document describing the entity's agent governance. |
| `schemapin_endpoint` | string | OPTIONAL | URL of the entity's SchemaPin discovery document, if any. Enables cross-protocol discovery. |
| `a2a_endpoint` | string | OPTIONAL | (v0.3) URL of the entity's A2A AgentCard endpoint (typically `https://{domain}/.well-known/agent-card.json`). Enables cross-protocol discovery from AgentPin into A2A. See §4.9, §4.10. |
| `web_bot_auth` | object | OPTIONAL | (v0.4) `{"signature_agents": ["https://…"]}`: the Web Bot Auth key directories this entity vouches for. See §18. |
| `max_delegation_depth` | integer | REQUIRED | Maximum delegation depth this entity permits. MUST be between 0 and 3 inclusive. |
| `updated_at` | string | REQUIRED | ISO 8601 datetime of the last update to this document. |

Expand Down Expand Up @@ -942,6 +944,7 @@ integer, `capabilities` an array of strings, and `agentpin_version` MUST equal
| `constraints` | object | OPTIONAL | Operational constraints (see §5.5). |
| `delegation_chain` | array | OPTIONAL | Delegation attestations (see §5.6). |
| `nonce` | string | OPTIONAL | Challenge nonce for mutual verification (see §9). |
| `cnf` | object | OPTIONAL | (v0.4) Key confirmation binding the credential to a Web Bot Auth key: `{"jkt": "<base64url SHA-256 JWK thumbprint>"}` (see §18). |

### 5.4 Capability Claims

Expand Down Expand Up @@ -1942,6 +1945,8 @@ This specification would register the following if submitted as an RFC:
- (v0.3) Perform DNS TXT cross-verification at `_agentpin.{domain}` (§4.8.3) as a second-channel trust signal. When implemented, the verifier MUST treat a mismatching record as a hard `DISCOVERY_INVALID` failure and an absent record as a no-op.
- (v0.3) Accept A2A AgentCards (§4.10) as discovery input, provided they have been verified per §4.10.4 (extension-signature verification AND key thumbprint matched against the AgentPin discovery document, unless an out-of-band provenance check is documented).

- (v0.4) Accept Web Bot Auth signed requests and bind them to AgentPin credentials (§18). When implemented, all of §18.4 MUST be applied.

### Verifiers SHOULD:
- Enforce credential constraints (domain, rate limit, data classification).
- Cache discovery documents per HTTP cache headers.
Expand All @@ -1951,7 +1956,117 @@ This specification would register the following if submitted as an RFC:

---

## 18. Future Work
## 18. Web Bot Auth Binding (v0.4)

Web Bot Auth (WBA, draft-ietf-webbotauth-httpsig-protocol) lets an automated
client sign HTTP requests with RFC 9421 HTTP Message Signatures so that
origins and edge providers can recognize it. A WBA signature identifies an
agent by the HTTPS URL of its key directory. AgentPin identifies an agent by
a domain-anchored credential. This section binds the two, so that a request
recognized at the edge by its WBA signature can also be attributed to a
specific AgentPin agent with its capabilities and constraints.

WBA keys are Ed25519 or RSA and separate from the ES256 keys of §7. The ES256
credential profile (§5) is unchanged, and an ES256 credential key MUST NOT
be used to sign HTTP messages.

### 18.1 Signing Requests

An agent signs requests per the WBA draft:

- `alg="ed25519"` with an Ed25519 key, or `alg="rsa-pss-sha512"` with an
RSA key. Signers SHOULD use RSA keys of 2048 to 4096 bits, and verifiers
MUST accept 2048 to 8192 bits. Ed25519 is RECOMMENDED. When present,
`alg` MUST match the key type.
- `keyid` is the JWK SHA-256 thumbprint of the key, base64url without
padding: RFC 8037 Appendix A.3 for Ed25519, RFC 7638 for RSA.
- `tag="web-bot-auth"`; `created` and `expires` are REQUIRED, and
`expires - created` SHOULD NOT exceed 24 hours.
- The covered components MUST include `@authority` (or `@target-uri`) and
the `Signature-Agent` member naming the agent's key directory
(`"signature-agent";key="<label>"`). They SHOULD include `@method` and
`@path`. Individual query parameters MAY be covered with
`"@query-param";name="<name>"` (RFC 9421 §2.2.8).
- A `nonce` of 64 random bytes, base64-encoded, SHOULD be included.
- `Signature-Agent` MUST be sent as a Dictionary
(`sig1="https://example.com/.well-known/http-message-signatures-directory"`).
Implementations MAY offer the legacy bare-String form for verifiers that
predate the Dictionary form.

### 18.2 Key Directory

The agent's operator publishes its keys as a JWK Set at the
`Signature-Agent` URL, normally
`https://{domain}/.well-known/http-message-signatures-directory`, served
with media type `application/http-message-signatures-directory+json`. Each
JWK's `kid`, when present, MUST be its thumbprint. Verifiers compute the
thumbprint from the key material and ignore entries that are not Ed25519
OKP keys or RSA keys of 2048 to 8192 bits.

The directory response SHOULD carry one possession-proof signature per key
(WBA Appendix B.1): covered components `"@authority";req` and
`content-digest`, `tag="http-message-signatures-directory"`, and `created`,
`expires` and `keyid`. Because the proof covers the request authority, a
server MUST NOT sign directory responses for hosts other than its own.

### 18.3 Credential Binding

To bind an agent's credential to its WBA key, the issuer sets the `cnf`
claim (§5.3) to `{"jkt": "<thumbprint>"}`, where `<thumbprint>` is the WBA
`keyid`. A `cnf.jkt` that is not a base64url SHA-256 thumbprint (43
characters, 32 bytes) is `MALFORMED_CREDENTIAL`.

The issuer's discovery document vouches for key directory URLs through
`web_bot_auth.signature_agents`, a list of 1 to 16 `https` URLs. A
directory may be hosted by a provider rather than on the entity's domain.
When the field is absent, only
`https://{entity}/.well-known/http-message-signatures-directory` is vouched
for. When it is present, it replaces that default.

The agent sends its credential as `Authorization: AgentPin <jwt>` (§13) and
covers `authorization` in its WBA signature.

### 18.4 Verification

A verifier accepting a WBA-bound request MUST:

1. Verify the WBA signature per the draft. Key lookup is keyed on the
`(Signature-Agent URL, keyid)` pair, never on `keyid` alone. The
Signature-Agent URL is the member the signature covers, normalized by
dropping its query and fragment.
2. Verify the credential per §6.
3. Confirm the signature covers `authorization`.
4. Confirm the credential's `cnf.jkt` equals the signature's `keyid`.
5. Confirm the Signature-Agent URL is vouched for by the credential
issuer's discovery document (§18.3).

Steps 1 and 2 have the outcomes of their own protocols. A WBA signature that
cannot be checked because its directory is unavailable, or the directory
lacks the key, is *unverified*, not invalid (WBA Appendix C.1). Failing step
3, 4 or 5 means the WBA identity and the AgentPin identity are not bound,
and the request MUST NOT be attributed to the AgentPin agent.

Verifiers that require replay protection SHOULD record each verified
signature's `(keyid, nonce)` pair until the signature expires and reject
repeats, and SHOULD treat a signature without a `nonce` as invalid. A
nonce is recorded only after the signature verifies, so that forged
requests cannot exhaust the store. The reference SDKs offer this as an
option on request verification.

### 18.5 Directory Fetching

The `Signature-Agent` URL is chosen by the client, so fetching it is a
server-side request forgery risk (WBA §6.7). Verifiers that fetch
directories MUST use `https`, MUST NOT follow redirects, MUST treat any
status other than 200 as a discovery failure, and SHOULD refuse hosts that
are or resolve to loopback, private, link-local or other non-public
addresses. They SHOULD bound response size, key count and fetch time. A
failed fetch MUST NOT evict a cached directory; a directory that resolves
without a key does replace the cached copy (WBA §6.10).

---

## 19. Future Work

1. **Transparency logging.** A CT-log style system for agent identity documents, allowing public auditability of all published discovery documents.

Expand Down
76 changes: 61 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,46 @@
# Changelog

## Unreleased — Rust cryptography

- Upgrade to p256 0.14 and require crypto-bigint >= 0.7.6 to address
RUSTSEC-2026-0387. Key generation uses the fallible OS-randomness API.
- Preserve PEM/JWK encodings, key IDs, credential DER signatures, and persisted
TOFU pins; add fixed vectors produced by the unmodified 0.3.0 SDK.
- Rust callers that name the public P-256 key types must also use p256 0.14.
This dependency update does not change the protocol on this branch.
- Require hickory-resolver >= 0.26.1 so downstream DNS-feature builds cannot
retain the older release affected by RUSTSEC-2026-0119.

All notable changes to the AgentPin project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.4.0] - 2026-11-11

Security release addressing the AP-1 through AP-23 review findings in all
four SDKs (Rust, Go, JavaScript, Python). Specification bumped to 0.4.0; the
document `agentpin_version` stays `"0.1"`.
four SDKs (Rust, Go, JavaScript, Python), plus Web Bot Auth support.
Specification bumped to 0.4.0; the document `agentpin_version` stays `"0.1"`.

### Added: Web Bot Auth

- RFC 9421 HTTP Message Signatures (`agentpin::httpsig`): signature base
construction, `Signature-Input`/`Signature` parsing, Ed25519 (strict
verification) and RSASSA-PSS SHA-512 (`rsa-pss-sha512`; signing keys of
2048 to 4096 bits, verification up to 8192) signing and verification,
`@query-param`, `Content-Digest`.
- Web Bot Auth profile (`agentpin::wba`), following
draft-ietf-webbotauth-httpsig-protocol-01: Ed25519 or RSA keys with JWK
thumbprint `keyid` (RFC 8037 / RFC 7638), request signing with a Dictionary `Signature-Agent`
(legacy String form opt-in), verification with verified / invalid /
unverified outcomes and key lookup keyed on (URL, keyid), and signed key
directory responses. Optional replay protection through
`VerifyOptions::nonce_store`, checked only after a signature verifies.
Reproduces the draft's Ed25519 test vectors and verifies its RSA-PSS
vectors; the shared vectors live in `testdata/web_bot_auth/vectors.json`.
- `agentpin::resolver_wba` (`fetch` feature): directory fetching with SSRF
limits (https only, no redirects, non-public addresses refused, size, key
count and time caps) and a cache that a failed refetch never evicts.
`net::fetch_bounded` and `net::is_non_public` back it.
- AgentPin binding (spec §18): optional `cnf.jkt` credential claim
(`credential::issue_bound_credential`), optional `web_bot_auth` discovery
field, and `wba::verify_bound_request` / `wba::check_binding`.
- `agentpin-server --wba-key` serves a signed
`/.well-known/http-message-signatures-directory`, only for its own hosts.
RSA keys are accepted as well as Ed25519.
- CLI: `agentpin wba keygen | directory | sign` (with `--query-param`) and
`agentpin issue --wba-jkt`.
- The ES256 credential profile is unchanged. The new fields are optional,
so documents and credentials without them verify as before.

### Breaking wire changes

Expand Down Expand Up @@ -61,7 +81,7 @@ document `agentpin_version` stays `"0.1"`.
(`key_pinning.status: "rotated"`).
- Server: HSTS is opt-in (`--hsts`).
- Go module now requires Go 1.26 (floor of the patched `golang.org/x/net`),
with Go 1.26.9 selected for its standard-library security fixes.
with Go 1.26.11 selected for its standard-library security fixes.

### Fixed

Expand Down Expand Up @@ -127,6 +147,32 @@ document `agentpin_version` stays `"0.1"`.
- Fuzz targets: cargo-fuzz crate in `fuzz/`, Go native fuzz tests,
fast-check (JS) and hypothesis (Python) properties.

### Rust cryptography

- p256 0.14 and crypto-bigint >= 0.7.6 (RUSTSEC-2026-0387), first shipped in
0.3.1. Key generation uses the fallible OS-randomness API.
- PEM/JWK encodings, key IDs, credential DER signatures and persisted TOFU
pins are preserved; fixed vectors produced by the unmodified 0.3.0 SDK
guard this.
- Rust callers that name the public P-256 key types must also use p256 0.14.
- hickory-resolver >= 0.26.1, so downstream DNS-feature builds cannot retain
the older release affected by RUSTSEC-2026-0119.

## [0.3.1] - 2026-11-04

Rust-only cryptography security backport, published to crates.io only. The
JavaScript, Python and Go SDKs stayed at 0.3.0.

- Upgrade to p256 0.14 and require crypto-bigint >= 0.7.6 to address
RUSTSEC-2026-0387. Key generation uses fallible OS randomness; rand 0.8 is
removed from the default dependency graph.
- Preserve the 0.3.0 wire protocol, including DER credential/delegation
signatures, PEM/JWK encodings, key IDs, and persisted TOFU pins. Regression
vectors were generated with the unmodified 0.3.0 SDK.
- Rust callers that name public P-256 key types must also use p256 0.14.
- Update optional DNS support to hickory-resolver >= 0.26.1 to address
RUSTSEC-2026-0119. Rust 1.89 is now required.

## [0.3.0] - 2026-05-14

### Added
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ AgentPin lets organizations publish verifiable identity for their AI agents. Iss
- **Signed A2A AgentCards** (v0.3) — extends the [A2A](https://github.com/google-a2a/A2A) AgentCard format with an AgentPin cryptographic-identity payload. `LocalAgentCardStore` for push-registered agents, `A2aAgentCardResolver` for `.well-known/agent-card.json` fetches.
- **DNS TXT cross-verification** (v0.3) — second-channel trust via `_agentpin.{domain}` TXT records (`v=agentpin1; kid=...; fp=sha256:<hex>`), defending against HTTPS-origin and TLS cert mis-issuance compromise.
- **`AllowedDomains` typed wrapper** (v0.3; tri-state since v0.4) — absent = unrestricted, `[]` = restricted to nothing, with pattern-aware intersection semantics for cross-protocol scoping with SchemaPin v1.4 `A2aVerificationContext`.
- **Web Bot Auth** (v0.4, all SDKs) — RFC 9421 HTTP message signatures with Ed25519 or RSA-PSS, a signed `/.well-known/http-message-signatures-directory`, and an optional binding from a WBA signature to an AgentPin credential (`cnf.jkt`), for edge providers that recognize bots by WBA.
- **Cross-language** — Rust, JavaScript, Python, and Go SDKs produce interoperable credentials and AgentCards. Cards signed in any SDK verify cleanly in the other three.

## Quick Start
Expand Down Expand Up @@ -48,7 +49,7 @@ Requires Rust 1.89 or later.

```toml
[dependencies]
agentpin = { version = "0.3", features = ["fetch"] }
agentpin = { version = "0.4", features = ["fetch"] }
```

### JavaScript
Expand Down Expand Up @@ -79,6 +80,7 @@ go get github.com/ThirdKeyAi/agentpin/go
| Getting Started | [docs.agentpin.org/getting-started](https://docs.agentpin.org/getting-started/) |
| Verification Flow | [docs.agentpin.org/verification-flow](https://docs.agentpin.org/verification-flow/) |
| A2A AgentCards (v0.3) | [docs/a2a-agentcards.md](docs/a2a-agentcards.md) |
| Web Bot Auth (v0.4) | [docs/web-bot-auth.md](docs/web-bot-auth.md) |
| CLI Reference | [docs.agentpin.org/cli-guide](https://docs.agentpin.org/cli-guide/) |
| Trust Bundles | [docs.agentpin.org/trust-bundles](https://docs.agentpin.org/trust-bundles/) |
| Delegation Chains | [docs.agentpin.org/delegation-chains](https://docs.agentpin.org/delegation-chains/) |
Expand Down
32 changes: 26 additions & 6 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# AgentPin Roadmap

![Version](https://img.shields.io/badge/current-v0.3.0-brightgreen)
![Next](https://img.shields.io/badge/next-v0.4.0-blue)
![Version](https://img.shields.io/badge/current-v0.4.0-brightgreen)
![Next](https://img.shields.io/badge/next-v0.5.0-blue)
![License](https://img.shields.io/badge/license-MIT-green)

**Domain-anchored cryptographic identity for AI agents — the identity layer of the ThirdKey trust stack.**
Expand All @@ -14,8 +14,9 @@
|---------|--------|----------|--------|
| **v0.1.0** | 2026-01 | Core identity, verification, delegation | Shipped |
| **v0.2.0** | 2026-02 | Trust bundles, alternative discovery, directory listing | Shipped |
| **v0.3.0** | 2026-05-14 | A2A AgentCard extension types + resolvers + AllowedDomains + DNS TXT (Rust, JavaScript, Python, Go) | **Shipped** |
| **v0.4.0** | Q3 2026 | Mutual auth as A2A handshake, hardware-backed keys | Planning |
| **v0.3.0** | 2026-05-14 | A2A AgentCard extension types + resolvers + AllowedDomains + DNS TXT (Rust, JavaScript, Python, Go) | Shipped |
| **v0.4.0** | 2026-11-11 | Security hardening (AP-1 through AP-23), Web Bot Auth (Rust, JavaScript, Python, Go) | **Shipped** |
| **v0.5.0** | TBD | Mutual auth as A2A handshake, hardware-backed keys | Planning |
| **v1.0.0** | Q4 2026 | Stable API, full specification compliance | Planning |

---
Expand Down Expand Up @@ -60,7 +61,26 @@ See [CHANGELOG.md](CHANGELOG.md#030---2026-05-14) for full release notes.

---

## v0.4.0 — Mutual Auth as A2A Handshake (Q3 2026)
## v0.4.0 — Shipped (2026-11-11)

A security release across all four SDKs, plus Web Bot Auth.

- **Security hardening** — the AP-1 through AP-23 review findings:
domain-separated signature inputs for challenge responses, delegation
attestations and AgentCards, delegation chains verified by default, signed
revocation documents and trust bundles, and hardened fetches. Several of
these are breaking wire changes; see the changelog.
- **Web Bot Auth** — RFC 9421 HTTP message signatures with Ed25519 or
RSA-PSS, signed key directories, replay protection, and a `cnf.jkt` binding
from a Web Bot Auth key to an AgentPin credential. See
[docs/web-bot-auth.md](docs/web-bot-auth.md).
- **Rust cryptography** — p256 0.14; Rust 1.89 or later is required.

See [CHANGELOG.md](CHANGELOG.md#040---2026-11-11) for full release notes.

---

## v0.5.0 — Mutual Auth as A2A Handshake

Adapts AgentPin's challenge-response mutual authentication as an A2A handshake protocol, enabling agents to cryptographically verify each other's identity before exchanging tasks.

Expand Down Expand Up @@ -115,4 +135,4 @@ We welcome input on roadmap priorities:

---

*Last updated: 2026-05-14 (v0.3.0 shipped — A2A AgentCard types, AllowedDomains, LocalAgentCardStore, A2aAgentCardResolver, DNS TXT cross-verification across Rust, JavaScript, Python, and Go)*
*Last updated: 2026-11-11 (v0.4.0 shipped — security hardening and Web Bot Auth across Rust, JavaScript, Python, and Go)*
Loading
Loading