doc/connections/SECURITY-THREAT-MODEL.md
Audience: engineers implementing or reviewing integration work on the Apps v2 substrate.
Post-read action: identify the mandatory authorization, credential, audit, and negative-test requirements before adding a new app, connection, transport, or provider wrapper.
Source: harvested from PAP-2359 and mapped onto the Apps v2 object model accepted in PAP-13211. The security decisions survived the Connections v1 retirement; the v1 implementation details did not.
Connections v3 adds forward security surfaces that later phases must threat-model in detail: subject-bound token requests, workspace/user grants, provider triggers, and the managed connector-service callback/webhook relay. Until those phases land, treat all four as untrusted boundaries: bind subjects and grants to the company, fail closed on revocation, authenticate and deduplicate triggers, and never trust relay-supplied tenant or connection identifiers without signed context and server-side ownership checks.
company_secrets. Connections store secret refs
and redacted metadata. Raw OAuth access tokens, refresh tokens, API keys, app
private keys, webhook secrets, and remote MCP bearer tokens must not live in
connection config, plugin config, issue comments, activity logs, exports, or
agent-visible payloads.Actors:
Trust boundaries:
Threats: spoofed OAuth callback, state replay, cross-company secret binding, forged app-installation metadata, forged remote MCP metadata, and token leakage.
Required controls:
company_secrets
first, then persist only refs and redacted account metadata on the connection.missing_secret,
degraded, failed, auth_required, or disabled equivalents.Threats: non-admin actors widening access, IDOR against another company's agent or connection, implicit writes, and transient broadening during replacement.
Required controls:
Threats: upstream schema drift adding destructive tools, provider metadata spoofing, and agents seeing tools without current permission.
Required controls:
Threats: BOLA/IDOR, excessive agency, prompt injection, secret disclosure, resource-filter bypass, and replaying old approval decisions.
Required controls at call time:
Threats: queued work continuing after revocation, broad provider crawls, and storing data outside approved filters.
Required controls:
Threats: spoofing, replay, tampering, wrong-company routing, and unaudited provider-origin mutations.
Required controls:
company_secrets; never copy them into inline
config.Threats: secret disclosure, cross-company principal binding, and imports starting with broad active access.
Required controls:
Cross-company isolation:
Ungoverned or overbroad access:
Revocation and failure-closed behavior:
OAuth and callback integrity:
Webhook integrity:
Redaction and agent safety: