| PKCE External Client App OAuth flow | Headless 360's trust model is OAuth 2.0 Authorization Code + PKCE via an External Client App, scopes `mcp_api` + `refresh_token`. The Pause prototype today consumes Salesforce surfaces under service-account or public-deployment identities — not under the end user's identity, which is what PKCE enables. | Shipped 2026-06-24 as a dormant seam. lib/salesforce-headless360.ts + the five routes under /api/salesforce/headless-360/* (config, authorize, callback, token/refresh, me, logout) implement the PKCE handshake with HMAC-signed session cookies. 25 unit tests pin the env-var parsing, the PKCE alphabet + S256 derivation, and the signed-cookie tamper-evidence invariants. Activate by setting SF_HEADLESS360_CLIENT_ID + AUTH_BASE_URL + REDIRECT_URI + SESSION_SECRET; see docs/HEADLESS_360_RUNBOOK.md for the External Client App procurement steps. | Wired in prototype |
| `mcp_api` scope on the Pause MCP server | Today the MCP server is unauthenticated against the public mock. Headless 360's MCP pattern expects the calling agent to present an OAuth token with `mcp_api` scope so the server can attribute tool calls to a Salesforce user identity for Event Monitoring and Shield audit. | Shipped 2026-06-27 as an env-gated middleware. validateMcpApiBearer in lib/salesforce-headless360.ts calls Salesforce's /services/oauth2/introspect (strict — verifies token is active AND scope contains mcp_api) with a /services/oauth2/userinfo fallback for orgs that disable introspect (permissive — verifies token aliveness only; result flags itself as `userinfo-fallback` so callers can log the weaker guarantee). Follow-ups landed same day: positive introspect results cached for 60s with a bounded LRU process-local Map (negatives re-check so freshly-issued tokens aren't stuck rejected), the validated identity threaded through the gate as X-Pause-MCP-User + X-Pause-MCP-Via response headers on every /api/mcp success, and a new GET /api/mcp/whoami diagnostic endpoint returning {gate: "on"|"off", via, username} so operators can verify the gate is wired correctly without parsing the SSE stream. The Care Router's MCP host (lib/mcp/host.ts) propagates the inbound bearer to the loopback remote only — never cross-origin to externally-configured MCP servers. 34 unit tests pin the introspect/scope/inactive/fallback matrix, the cache TTL + negative-no-cache + per-token-isolation behavior, the same-origin host guarantee, and the whoami diagnostic envelope. Activate by setting SF_HEADLESS360_REQUIRE_MCP_AUTH=on alongside the existing SF_HEADLESS360_* env (provisioned during gap #1 activation). The Agentforce 3.0 Registry public-mock posture stays the default when unset. | Wired in prototype |
| Agent Fabric → Salesforce Platform Event egress | Headless 360 leans on Salesforce Shield + Event Monitoring for governance. The Pause prototype already records spans on its own Agent Fabric trace surface, but doesn't yet ship them into the customer org. Note: Real-Time Event Monitoring's catalog (LoginEvent / ApiEvent / etc.) is Salesforce-platform-internal — external apps cannot define a new RTEM event type. The partner-supported pattern is publishing custom Platform Events, which the customer admin then routes into their audit pipeline (Transaction Security policies, Flow subscribers, Pub/Sub gRPC, etc.). | Shipped 2026-06-24 as a dormant seam. lib/salesforce-platform-event-sink.ts emits each Agent Fabric span as a custom Pause_Agent_Trace__e Platform Event via REST sObjects, authenticated via OAuth 2.0 Client Credentials against a dedicated Connected App. Best-effort, fire-and-forget — recordSpan() never waits on the sink and never throws on Salesforce errors. 22 unit tests pin env parsing, schema mapping, truncation, token caching, and the no-throw invariant on Salesforce failures. Activate by setting SF_PLATFORM_EVENT_BASE_URL + SF_PLATFORM_EVENT_CLIENT_ID + SF_PLATFORM_EVENT_CLIENT_SECRET; see docs/SF_PLATFORM_EVENT_SINK_RUNBOOK.md for the Connected App + Platform Event procurement steps. | Wired in prototype |
| Salesforce CLI parity for Pause tools | Headless 360's tagline includes 'CLI command' alongside 'API and MCP tool.' The Salesforce CLI is the operator-facing surface for everything an agent can do — Pause needed the third surface to complete the trio. | Shipped 2026-06-27 as an in-repo package: `cli/` builds to `@pause-health/cli` with `pause health`, `pause providers`, `pause timeline`, and `pause intake` commands wrapping the same `/api/mulesoft/*` surface the MCP server exposes. Hand-rolled argv parser (zero runtime deps) keeps the install lean. Supports `--json` for jq piping and `--base-url` / `PAUSE_BASE_URL` for hitting preview deploys. 17 unit tests pin the parser + client; 6 smoke cases exercise the built bin against the live Experience APIs. Not published to npm yet — gap #4 of the audit ships the artifact; the npm-scope ownership decision is a separate ops step. See `cli/README.md` for install + usage. | Wired in prototype |