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
16 changes: 16 additions & 0 deletions docs/building/by-layer/L1/wba-profile.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,22 @@ The vectors live at `static/compliance/source/test-vectors/wba-profile/` and are

The keys in `keys.json` are public test keys with published private seeds. Section 6.8 says test keys "MUST NOT be used in production", and verifiers SHOULD reject them when detected. The README in the vector directory describes the file format and the harness state each vector needs.

## Try it against the training agent

The training agent runs this profile end to end at `https://test-agent.adcontextprotocol.org/sales/identity/mcp`. It verifies Web Bot Auth signatures, binds a signer through open sandbox onboarding (`sync_principal`), and checks [demand-side grants](/docs/building/by-layer/L2/accounts-and-agents#grants-in-trust-records-experimental) in the brand's house trust.json before any account or spend. Unsigned callers can only discover it (`get_adcp_capabilities`), and its capabilities advertise `request_signing.profiles: ["web-bot-auth"]` and `account.agent_onboarding.sandbox.mode: "open"`.

Only the route's fictional fixture identities resolve. Their documents are served in-process, and every real domain is refused. Sign as one of these agents with its published key from [`fixture-world.ts`](https://github.com/adcontextprotocol/adcp/blob/main/server/src/training-agent/identity33/fixture-world.ts):

| Agent origin | Who it is | What a `sync_accounts` for brand `nova-motors-7k3q.com` (brand ID `nova_motors`) shows |
|---|---|---|
| `https://buyer.pinnacle-agency-7k3q.com` | An agency the house granted media buying for Nova Motors in the US and GB | Accepted through the parent's grant. Nova Motors publishes no trust.json of its own. A market outside the grant is refused. |
| `https://buyer.nova-brands-7k3q.com` | The house's own buying agent | Accepted with implicit authority when the account operator is `nova-brands-7k3q.com`; no grant needed |
| `https://buyer.quickmedia-7k3q.com` | An impostor with no grant | `PERMISSION_DENIED`, `grant_absent`, whichever operator it names |

A brand of `offline-brand-7k3q.com` exercises an unavailable trust record: spend fails closed with `SERVICE_UNAVAILABLE`.

The fixture keys are published sandbox keys, like `keys.json`: anyone can sign as these fictional agents, and the training agent trusts them only for these origins and only for sandbox accounts. Never trust them anywhere else. The route is experimental and may change with the profile.

## References

- [HTTP Message Signatures for automated traffic, draft-ietf-webbotauth-httpsig-protocol-00](https://datatracker.ietf.org/doc/draft-ietf-webbotauth-httpsig-protocol/00/)
Expand Down
4 changes: 4 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ primary_region = 'iad'
ADDIE_ROUTER_LUNA_SHADOW_HMAC_KEY_VERSION = "governance-pilot-v1"
# AdCP 3.2 beta is public; expose the deterministic proposal-negotiation labs.
ENABLE_ADCP_3_2_PROPOSAL_PROFILES = "true"
# Experimental AdCP 3.3 identity lab on the training agent: Web Bot Auth,
# open sandbox onboarding, and demand-side trust.json grants at
# /sales/identity/mcp. Only its fictional fixture identities resolve.
ENABLE_ADCP_3_3_IDENTITY_ROUTE = "true"
# Deployment-time ceiling for the issue #6827 read-only authorization canary.
# The database runtime gate remains independently disabled until explicitly armed.
ORG_AUTHORIZATION_ENFORCEMENT_ENABLED = "true"
Expand Down
5 changes: 4 additions & 1 deletion server/src/training-agent/identity33/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
} from '@adcp/sdk/identity-3.3';
import { verifySignatureAsAuthenticator, type Authenticator } from '@adcp/sdk/server';
import type { AdcpStateStore } from '@adcp/sdk/server';
import { StaticJwksResolver } from '@adcp/sdk/signing';
import { StaticJwksResolver, type ReplayStore } from '@adcp/sdk/signing';
import type { IncomingMessage } from 'node:http';
import { accountRefForId } from '../account-handlers.js';
import { mcpOperationResolver } from '../request-signing.js';
Expand Down Expand Up @@ -97,6 +97,8 @@ export interface Identity33Runtime {

export function createIdentity33Runtime(options: {
stateStore: AdcpStateStore;
/** Shared across replicas so a nonce accepted on one machine is refused on the others. */
replayStore?: ReplayStore;
getUrl: (req: IncomingMessage & { rawBody?: string }) => string;
}): Identity33Runtime {
const fetchOptions = { trustedFetchFn: fixtureFetch };
Expand All @@ -123,6 +125,7 @@ export function createIdentity33Runtime(options: {
// RFC 9421 keys are not accepted here; only Web Bot Auth identities.
jwks: new StaticJwksResolver([]),
webBotAuth: { directory, resolvePrincipal },
...(options.replayStore && { replayStore: options.replayStore }),
getUrl: options.getUrl,
resolveOperation: mcpOperationResolver,
});
Expand Down
2 changes: 1 addition & 1 deletion server/src/training-agent/request-signing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ export function requestSigningProfileVersion(ctx: SigningRouteContext): RequestS
* lose cross-instance replay protection — production must have a pool.
*/
let _replayStore: ReplayStore | null = null;
function getReplayStore(): ReplayStore {
export function getReplayStore(): ReplayStore {
if (_replayStore) return _replayStore;
try {
_replayStore = new PostgresReplayStore(getPool());
Expand Down
7 changes: 6 additions & 1 deletion server/src/training-agent/tenants/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { createLogger } from '../../logger.js';
import { runWithAccountIdAliasScope, runWithSessionContext, flushDirtySessions } from '../state.js';
import { createRegistryHolder, pickStateStore, resolveTenantHost, type RegistryHolder } from './registry.js';
import { createIdentity33Runtime } from '../identity33/runtime.js';
import { getReplayStore } from '../request-signing.js';
import { advertiseIdentity33Capabilities, requireIdentity33, signedRequestUrl } from '../identity33/route.js';
import { getTrainingGovernanceIssuer } from '../canonical-base.js';
import {
Expand Down Expand Up @@ -1600,7 +1601,11 @@ export function mountTenantRoutes(
}

if (tenantIds.includes('sales') && middleware.storyboardCompat?.version !== '3.0' && identity33RouteEnabled()) {
const runtime = createIdentity33Runtime({ stateStore: pickStateStore(), getUrl: signedRequestUrl });
const runtime = createIdentity33Runtime({
stateStore: pickStateStore(),
replayStore: getReplayStore(),
getUrl: signedRequestUrl,
});
const identityHolder = createRegistryHolder({ identity33: { authorize: runtime.authorize }, tenantIds: ['sales'] });
parent.options(IDENTITY33_ROUTE, (_req, res) => {
setCORSHeaders(res);
Expand Down
Loading