12

Threat Model, Tests, and Rollout

Source: How Enterprise Authentication and Authorization Work in an Agent Platform, sections 34 and 36–39; turns the final architecture and implementation order into release evidence.

The enterprise problem and today’s slice

Enterprise problem: A plausible authorization architecture can still ship creator privilege, cross-team credential leaks, confused-deputy calls, prompt-driven tool escalation, stale grants, or public-agent access because happy-path demos do not exercise hostile boundary crossings.

Whole-course context: The incoming evidence is an immutable deployment, two-key runtime path, independently revocable app/provider grants, and complete redacted decision lineage; today converts those artifacts into executable release gates.

Today’s slice: We build a threat model and negative-test matrix across provider control plane, hosted runtime, generated application, connectors, agent delegation, and downstream authorities, then stage canary, production, rollback, and retirement.

End-of-day evidence: A signed release dossier maps each named attack to a control and observed test, proves positive controls, records exact artifact and policy digests, and includes canary promotion or rollback plus residual-risk acceptance.

Still unsolved: Organization-specific legal approvals, production credentials, capacity targets, incident staffing, and irreversible final deletion require accountable owner gates outside this course.

Customer use cases

A release checklist can pass while a real attacker crosses an untested plane, so each customer job must connect named threats to executable positive and negative evidence. The final rollout is allowed only for the exact build that produced that evidence.

Use case IDActorCustomer jobSuccess outcomeDenial or recovery evidence
D12-UC-01Enterprise security engineerAttack the authorization boundaries before customers doEvery threat has an owning control, test fixture, expected denial, observed result, immutable trace, and adjacent positive control across app, provider, runtime, connector, agent, and downstream planesAny privilege union, wrong audience, schema drift, argument substitution, stale membership, unauthorized data row, or public connector call fails the release gate with a reproducible counterexample
D12-UC-02Accountable release ownerRoll the exact verified build from isolated test through canary to production and recover or retire safelyPromotion pins artifact, policy, schema, infrastructure, and test-evidence digests; production probes match canary; rollback and retirement preserve customer data and audit obligationsA failed canary blocks promotion, rollback restores the last verified release, and retirement denies new use before export/retention/deletion jobs proceed under separate approval

The threat model assumes prompts, retrieved documents, websites, tool output, model reasoning, generated code, caller-supplied IDs, and agent-authored role claims are hostile. Trusted inputs are authenticated identity, current membership, immutable deployment metadata, reviewed policy bundles and tool schemas, workload identity, app-owned session and role state, connector registry, and downstream resource policy—but every trusted component can fail unavailable or stale and needs tests for that failure.

Actor-centred user stories

Security requirements that say only “prevent escalation” cannot be falsified, so stories name the attack, expected terminal signal, and evidence linkage. Release authority is separate from security test execution to prevent one actor from silently accepting their own failed control.

Story IDUse case IDsUser storyObservable acceptance conditions
D12-US-01D12-UC-01As a security engineer, I want hostile identity, sharing, tool, delegation, knowledge, runtime, and app-data probes executed against the release candidate, so that no single-plane allow or model instruction can expand effective authorityEvery matrix row has actor, resource, scope, precondition, expected and observed result, environment, timestamp, source fixture, trace/decision ID, control owner, and positive control; all mandatory denies occur at the intended enforcement point; an unexpected allow blocks release
D12-US-02D12-UC-02As a release owner, I want canary promotion, rollback, and retirement tied to the exact verified digests, so that production cannot drift from the reviewed candidate and recovery does not corrupt application dataFour-eyes approval selects a signed dossier; canary runs user, workload, network, tool, app-row, and audit probes; production reports identical digests; rollback is rehearsed; retirement disables entry points before exports and approved deletion; every transition is immutable

The bounded platform envelope is tested with contrasting archetypes: a private collaborative Workboard proves tenant rows and roles; an organization-scoped revenue dashboard proves delegated connector reads and downstream row policy; and a public intake application proves anonymous create can be allowed while anonymous read, enumeration, export, administration, and enterprise connectors remain denied. A falsifier in any archetype rejects the shared invariant instead of being dismissed as an app-specific exception.

End-to-end product flows

Passing unit tests does not prove the deployed candidate enforces the same policy, so the flow begins with a visible “Evaluate release” action and carries immutable identity into canary and production. The test harness never receives broad production credentials; it invokes normal product surfaces as bounded test principals and workloads.

Flow IDUse case IDsPathTriggerNumbered stepsTerminal evidence
D12-FLOW-01D12-UC-01HappySecurity engineer starts “Run mandatory authorization suite” for a release candidate1. Test orchestrator resolves candidate artifact, policy, tool-schema, infrastructure, and fixture digests.<br>2. It provisions isolated organizations, teams, app tenants, users, groups, connectors, documents, workloads, deployments, and agents with least privilege.<br>3. It executes positive controls and mandatory denied cases for identity, sharing, app rows, knowledge trimming, tools, arguments, protocol tokens, delegation, runtime, prompt injection, and revocation.<br>4. Every request goes through production-equivalent policy enforcement and redacted audit.<br>5. Coverage service confirms every threat maps to at least one control and observed test, and every use-case invariant is exercised by multiple archetypes.<br>6. Signer seals the dossier only if no unexpected allow, missing evidence, or secret leak exists.For each probe: actor, exact resource, scope, precondition, expected result, observed result and enforcement point, isolated environment, timestamp, artifact/policy/schema digests, immutable source fixture, trace and decision IDs; dossier adds coverage manifest and signature
D12-FLOW-02D12-UC-01DeniedA retrieved document instructs the revenue-dashboard agent to use an administrator export tool and substitute an executive account1. Model may emit the malicious intent, but cannot provide trusted team, connector, role, or approval state.<br>2. Tool gateway loads original subject/team, immutable deployment manifest, reviewed schema, connector binding, and structured arguments.<br>3. Manifest and deployment exclude admin.export; argument policy also rejects the account.<br>4. No capability token, secret resolution, or downstream request occurs.<br>5. An approved dashboard read succeeds as a positive control.<br>6. Prompt-injection denial metric and complete trace are asserted.Actor and agent actor, forbidden tool/account resources, requested scopes, hostile-document precondition, expected gateway denial, observed no broker/downstream call and allowed read control, environment, timestamp, policy digest, fixture hash, decision ID, and trace ID
D12-FLOW-03D12-UC-02HappyRelease owner approves signed dossier for canary and then production1. Promotion service verifies separation-of-duty approvals and all dossier signatures.<br>2. Canary controller deploys the exact artifact with pinned policy, schema, network, and workload revisions.<br>3. Synthetic principals exercise each boundary plus audit completeness and revocation freshness.<br>4. Owner reviews customer-visible health, denial, latency, and drift evidence.<br>5. Production promotion changes only the immutable release pointer.<br>6. Post-promotion probes compare served digest and alias against the approved candidate.<br>7. Release record closes with owner, timestamps, results, and residual-risk acceptance.Actor, release resource and production scope, signed-dossier precondition, expected exact-digest promotion, observed canary/production probes, environment, timestamps, source commit, artifact/policy/schema/infrastructure digests, deployment ID, and immutable release transition ID
D12-FLOW-04D12-UC-02RecoveryCanary shows an authorization-staleness breach or production must retire the application1. Controller blocks further promotion and selects the last verified immutable release for rollback, or disables all new entry surfaces for retirement.<br>2. Runtime cancels incompatible runs and reconciles prior workload/network state.<br>3. Generated-app database remains at its compatible schema and is not restored from a code rollback.<br>4. Recovery probes verify intended access and all mandatory denies.<br>5. For retirement, customer export and retention jobs run under separate approvals before cryptographic erasure or deletion.<br>6. Provider source, runtime artifacts/secrets, app data, connector grants, and audit records follow their owning deletion schedules.<br>7. Residual retained/irrecoverable data is documented.Actor, failed or retired release resource, rollback/retire scope, failing-probe precondition, expected containment, observed prior digest or denied entry points, data-integrity result, environment, timestamps, incident/retirement ID, deletion-job IDs, and immutable evidence bundle

Mandatory adversarial matrix

An untested attack is an undocumented acceptance decision, so the release gate includes at least these categories:

CategoryMandatory probesIntended control
Identity and agent accessOutside organization; disabled user; former member; view-only user tries run; deployment absent from active team; unapproved versionCurrent identity/membership plus explicit team deployment and action grant
Sharing and generated appSource team token copied to target team; builder probes app rows; app user probes source; wrong tenant; public route reads/exports/administers; public deployment requests private graph or connectorSeparate package/bindings, project/preview/app authorities, tenant predicates, route policy, public-safe capability class
MCP and connectorsWrong/expired audience; provider token passthrough; disabled/unmanifested tool; changed schema; unavailable connectorResource-specific token, strict audience, no passthrough, filtered discovery, schema hash/quarantine, explicit connector binding
Arguments and downstream dataAllowed Slack tool targets forbidden channel; read grant used for write; SQL escapes schema; Drive escapes folder; CRM targets unapproved accountExact operation and argument policy plus downstream resource authorization
Agent delegationCaller invokes inaccessible callee; callee exceeds user; cycle; depth/fan-out/budget exceeded; parent cancelledOriginal subject/actor preservation, authority intersection, audience binding, cycle and budget limits, cancellation propagation
Runtime and prompt injectionStolen run token from wrong workload; trusted workload without token; arbitrary egress; document requests admin export; model invents approvalTwo-key workload/user rule, strict mTLS, default-deny egress, independent gateway policy, immutable trusted context
RevocationUser, connector, deployment, approval, app grant, or arguments change during runVersions/events, immediate high-risk recheck, fresh token, argument digest, session/stream/job convergence

The named threat cases include creator privilege inheritance, cross-team credential leakage, confused deputy, MCP token passthrough, prompt-injected tool use, shared service-account overreach, tool-definition drift, argument substitution after approval, membership revocation delay, and public-agent escalation. Each control is designed so compromise of one plane still meets a veto in another.

System design derived from the flows

Tests become ceremonial when fixtures bypass real gateways or evidence can be altered by the release owner, so the verification system uses production-equivalent entry points and independently signed stores. Control owners fix failures; the release orchestrator only evaluates declared evidence.

Use case IDEntry pointResponsible servicesAuthoritative storeFailure evidence
D12-UC-01Security evaluation console and versioned test manifestThreat registry; fixture provisioner; product-surface probe runner; policy, protocol, delegation, app-row, knowledge, runtime, and revocation test adapters; audit validator; coverage checker; evidence signerVersioned threat/control/test manifest owned by security engineering; immutable probe event store owned by evidence service; source fixtures owned by test repositoryUnexpected allow, expected allow denied, wrong enforcement point, missing positive control, uncovered threat, missing field/trace, secret canary, digest mismatch, or unreproducible fixture
D12-UC-02Release approval, canary, rollback, and retirement consolesSeparation-of-duty approval service; release orchestrator; artifact verifier; canary controller; runtime reconciler; synthetic monitor; rollback controller; export/retention/deletion workflowsSigned dossier and release transitions owned by provider control plane; observed deployment state owned by hosted runtime; domain data and schema state owned by generated app; audit retention owned by security operationsInvalid signature, stale approval, canary or post-promotion probe failure, served-digest drift, rollback reconciliation failure, data corruption, deletion-before-export attempt, or incomplete retirement evidence

The implementation sequence reduces dangerous dependency inversions: establish enterprise identity, team membership, active-team selection, and revocation; separate creator from durable agent owner and make versions immutable; declare capabilities without credentials and bind them per team deployment; route exact tool intents through a gateway with argument constraints and approval; harden MCP discovery, audience, schema review, and token exchange; secure agent-to-agent delegation with authority intersection and limits; then add complete operations, outage exercises, and cross-team attack tests. Later phases never weaken earlier boundaries.

Production readiness is a proof set, not a checkbox count: identity covers enterprise federation, multifactor authentication for privileged users, issuer/audience validation, short tokens, and current membership; sharing keeps packages separate from credentials and app access; connectors distinguish user and service authority, minimize OAuth scopes, and vault tokens; runtime has no broad credentials and enforces mTLS plus workload allowlists; audit retains actor chain, policy version, credential mode, approval, redaction, and SIEM export.

Data model and ownership

Release safety collapses if test results can point at mutable tags or if retirement treats provider source, runtime secrets, and app records as one deletion object. The model pins every proof to immutable digests and lets each plane execute its own reviewed lifecycle.

Generated-application database: Not created in this slice — the release system exercises existing app tenant, role, route, row, and lifecycle behavior through isolated fixtures, while durable threat, evidence, release, rollback, and retirement state belongs to provider and hosted-runtime stores rather than a new production app database.

Record or entityStore and ownerPrimary keyForeign key or opaque referenceTenant keyMaterial constraintLifecycle and deletionUse case IDs
ThreatCaseSecurity manifest repository; security engineeringthreat_case_id plus manifest digestLocal control/test IDs; opaque plane owner referenceNone — threat definitions apply across tenants while fixtures are tenant-scopedNamed attack, protected asset, trust boundary, precondition, control owner, expected outcome, and residual risk required; immutable per digestReview and version; supersede without erasing old definitions; retain with every referencing releaseD12-UC-01
TestCaseVersioned test repository; security quality ownertest_case_id plus fixture digestLocal threat_case_id; opaque product route and policy referencesorganization_fixture_idMust use normal enforcement path and declare positive control, expected enforcement point, evidence schema, and deterministic setupExecute per candidate; quarantine flaky cases rather than ignore; retain source with release evidenceD12-UC-01
ProbeObservationImmutable evidence store; evidence serviceprobe_observation_idLocal test ID; opaque actor, resource, decision, trace, artifact, and policy referencesorganization_fixture_id plus optional app_tenant_fixture_idActor/resource/scope/precondition/expected/observed/environment/time/immutable ID mandatory; append-only and redactedAppend during test/canary/production; sign batch; retain by release/audit policy; delete sensitive fixture payload separatelyD12-UC-01, D12-UC-02
ReleaseDossierProvider release store; release governancedossier_digestLocal observation manifest; opaque artifact, policy, schema, infrastructure, source commit, and approval referencesorganization_id plus target team/environmentAll required tests covered, no unexpected allow, exact digests signed, separation-of-duty approvals currentCreate after evaluation; invalidate on any referenced digest change; retain permanently or by regulated release policyD12-UC-01, D12-UC-02
ReleaseTransitionProvider deployment store; release orchestratorrelease_transition_idLocal prior/next dossier and artifact references; opaque runtime revisionorganization_id plus team and environmentState machine allows candidate → canary → production, block, or rollback; served digest must equal approved digestAppend every transition; never overwrite; retain through artifact and audit retentionD12-UC-02
RuntimeAttestationHosted-runtime state store; runtime reconcilerruntime_attestation_idOpaque release transition; local workload, network, secret-reference, and policy revisionsorganization_id plus deployment IDObserved artifact/policy/schema/infrastructure digests and workload identity must equal desired stateIssue after reconciliation and periodically; revoke on drift; retain with release evidence; purge operational detail laterD12-UC-01, D12-UC-02
RetirementPlanProvider lifecycle store; retirement orchestratorretirement_plan_idOpaque provider project, runtime deployment, generated app, connector, export, audit-retention, and deletion-job referencesorganization_idDisable entry points before data action; explicit owner/approval/deadline per plane; legal hold blocks deletion; deletion cannot precede required exportDraft, approve, disable, export, retain, delete or cryptographically erase, verify; preserve signed tombstone and residual statementD12-UC-02
ResidualRiskAcceptanceGovernance store; accountable ownerrisk_acceptance_idLocal dossier or retirement plan; opaque threat and evidence referencesorganization_idNamed owner, bounded scope, rationale, compensating control, expiry, and review date; cannot waive an unexpected cross-tenant allowApprove separately; expire automatically; renew with fresh evidence; retain decision under governance policyD12-UC-01, D12-UC-02

The final invariant remains an intersection: enterprise user is authenticated and mapped to current organization/team; user and team may run one immutable deployment; deployment declares approved capabilities; model proposes but does not grant; gateway authorizes exact tool and arguments; broker resolves the correct user or service credential; protocol server validates its own audience; downstream system enforces resource permission; generated app enforces its tenant, route, role, and row predicates; and audit records the full chain. Creator authority is never inherited, sharing logic never shares credentials, and every privileged action is authorized again at execution time.

Source-visual inventory and fidelity

Static architecture sketches can look like empirical models when their source and adaptation limits are hidden, causing readers to infer precision or dynamics that the article never supplied. The primary source here is an unpaginated text attachment, so printed-page and PDF-page fields are unavailable; the canonical inventory uses exact source-line anchors and records every substantive diagram detected by the course parser’s visual-art rule.

All 17 source visuals are conceptual reconstructions, not transcriptions, calibrated simulations, or interactive labs. They preserve topology, ordering, trust boundaries, and allow/deny arguments as Mermaid diagrams in the mapped lessons. They are explicitly excluded from the interactive-lab registry because the source provides no data series, algorithm, or parameter semantics: inventing three controls would invent unsupported behaviour rather than reveal the source. This exclusion would be falsified if a source dataset, algorithm, or parameterized state model were supplied; that evidence would require atomic labs, controls, readouts, protocols, and responsive browser proof.

Manifest IDSource traceOriginal argumentMapped course reconstruction
agent-auth-source-visual-01Line 87, platform/team treeOrganization teams remain separate authority scopesDay 04 identity and effective-authority architecture
agent-auth-source-visual-02Line 545, active-team treeMulti-team membership must not become a permission unionDay 05 login and active-team flow
agent-auth-source-visual-03Line 778, agent versionsReview and deployment bind immutable behaviourDay 01 agent/version entity model
agent-auth-source-visual-04Line 973, deployment treeShared logic receives independent team bindingsDay 01 deployment architecture
agent-auth-source-visual-05Line 1261, unsafe runtimeAmbient team credentials create standing authorityDay 06 run-admission threat model
agent-auth-source-visual-06Line 1273, bounded runtimeRuntime receives only narrowed run inputsDay 06 two-key and capability flow
agent-auth-source-visual-07Line 1393, user OAuthA personal call resolves only that user’s grantDay 08 delegated-access flow
agent-auth-source-visual-08Line 1422, managed OAuthScheduled work uses a durable team service principalDay 08 managed-access flow
agent-auth-source-visual-09Line 1822, MCP architectureDiscovery, arguments, credentials, and source ACLs are separate gatesDay 07 MCP gateway architecture
agent-auth-source-visual-10Line 2185, IdP groupsEnterprise groups explicitly narrow connector discoveryDay 08 enterprise-managed discovery model
agent-auth-source-visual-11Line 2433, approval flowApproval binds one immutable intent and one useDay 09 approval/delegation flow
agent-auth-source-visual-12Line 2730, security trimmingUnauthorized chunks are removed before model contextDay 02 knowledge-authorization flow
agent-auth-source-visual-13Line 3031, revocation streamGrant changes invalidate caches and active work within boundsDay 11 revocation convergence flow
agent-auth-source-visual-14Line 3067, repository treePolicy, infrastructure, environments, and tests stay separately ownedDay 10 trust-boundary architecture
agent-auth-source-visual-15Line 3359, delivery pipelineValidation and canary evidence bind the promoted digestDay 10 release flow
agent-auth-source-visual-16Line 3529, event lineageSession-to-provider identifiers form one causal chainDay 11 audit architecture
agent-auth-source-visual-17Line 3997, final architectureEvery plane and downstream system enforces an independent gateDay 12 production architecture