DocsOpen app

Threat-model suite (POL-5)

Acceptance (PLAN/lanes.json POL-5): every §10.3 threat has a failing-before / passing-after test.

Acceptance (PLAN/lanes.json POL-5): every §10.3 threat has a failing-before / passing-after test. Here that is literal: every control has tests named threat_* (or a named test that already pinned it) next to the code it guards, and a mutant in threat/mutants/ that disables exactly that control. The tests pass on the tree (passing-after); with the mutant applied they fail by assertion (failing-before).

sh
scripts/threat.sh check            # passing-after: every mutant's tests pass here and exist
scripts/threat.sh mutants [NAME…]  # failing-before: each mutant applied to a scratch copy fails its tests
scripts/threat.sh supply           # Zuppo's own CI: pinned steps, no privileged fork trigger, read-only tokens, no PR secrets, regex-engine ban
scripts/threat.sh fuzz [SECS]      # every fuzz target for SECS seconds (check.sh: 20)
scripts/threat.sh list             # the mutants, their threats and controls
scripts/fuzz.sh 3600               # the long fuzz run (nightly CI job, git-wire.yml)

scripts/check.sh runs supply, check and the fuzz smoke; ZUPPO_THREAT_MUTANTS=1 adds mutants (13 minutes for all of them on a warm scratch build: each mutant rebuilds the crates it touches in target/threat-scratch). A mutant is a unified diff with a header:

Code
# threat: SEC-T3                       (or a class: tokens, path-escape, tenant, want, hidden-ns, dos)
# control: what the mutation removes, and where
# run: the command that runs its tests, from the repository root
# expect: a test that must fail with the mutant and pass without it (one or more)

A mutant that no longer applies, does not build, whose tests do not run, or that leaves its tests passing fails mutants; a renamed or deleted test fails check.

§10.3 threats

ThreatControlPassing-after testsFailing-before mutantsState
SEC-T1 public issue text hijacks an agent with a broad tokenone repository per grantzuppo-grant a_grant_needs_a_registered_agent_and_its_own_sponsor, effective_rights_are_the_sponsor_and_the_grant_and_the_org_policyt1-one-repo-per-grant, t1-grant-locationbuilt
a session that read private data and untrusted input needs a person for an external change (Rule of Two), wired for every agent write and readzuppo-policy sec4_untrusted_input_private_data_and_an_external_write_need_a_person; zuppo-forge threat_t1_tainted_session_cannot_comment_publicly, threat_t1_tainted_session_cannot_post_a_finding_or_check_run_publicly, threat_t1_tainted_session_cannot_upload_evidence_publicly, threat_t1_session_read_taints_the_sessiont1-rule-of-two, t1-review-rule-of-two, t1-evidence-rule-of-two, t1-session-read-taintbuilt; comments, findings, check runs and session reads were not wired before this suite; evidence uploads (SYNC-2) wired when they landed
a grant chain's sessions share one taint: a sub-agent's reads count for its parent, and narrowing to a fresh session (NarrowGrant or /oauth/token session=) sheds nothing before the Rule of Twozuppo-forge threat_t1_narrowing_to_a_fresh_session_keeps_the_taintt1-chain-taintbuilt; taint was kept per session label only before the internal security review
trust labels on text agents readzuppo-forge only_member_text_typed_in_the_forge_is_trusted; zuppo-api-v3 threat_t1_agent_and_imported_text_is_never_labelled_membert1-trust-labels, t1-v3-author-associationbuilt; /api/v3 called every author MEMBER before this suite
SEC-T2 exfiltration through a trusted rendering channel (CamoLeak)AI and repository text renders as text: the only markup sink (code cells: a diff's, and the code view's lines made of the server's highlight spans) holds escaped token HTML, never <img>web threat_t2_code_cells_hold_text_never_markupt2-code-cells-escapebuilt (no markdown or image rendering exists; no image proxy exists, so nothing signs URLs)
SEC-T3 an agent edits its own config to escalatesensitive paths need a person; CI, CODEOWNERS, REVIEW.md, .zuppo/settings.json never written by an agentzuppo-policy sec6_an_agent_write_to_a_sensitive_path_needs_a_person; zuppo-pushprot an_agent_never_writes_ci_files_even_inside_its_envelope_or_by_deleting_themt3-sensitive-paths, t3-never-writablebuilt
the CI directories (.github, .gitlab, .forgejo, .gitea) are never written as a file or symlink by an agent (a symlinked .github would make another directory the workflows on a checkout)zuppo-grant threat_t3_a_ci_directory_written_as_a_file_or_symlink_is_never_writablet3-ci-directoriesbuilt
SEC-T5–T8 privileged CI on untrusted input; token worm; cache poisoning; CI secrets leakedshort-lived tokens (15 min default, 1 h max)zuppo-auth agent_tokens_live_15_minutes_by_default_and_never_more_than_an_hourt5-token-ttlbuilt
no privileged-on-fork trigger, read-only CI tokens (Zuppo's own CI)supply::threat_t5_no_trigger_runs_untrusted_code_with_privileges, supply::threat_t5_ci_tokens_are_read_onlyt5-privileged-trigger, t5-write-tokenbuilt for Zuppo's own CI; the forge's CI is not built yet (CI lanes)
a leaked Zuppo token is revoked (worm)zuppo-pushprot a_leaked_zuppo_token_refuses_the_push_and_is_revokedt6-leaked-token-revokedbuilt for pushes; text sent through the API is not scanned
a secret allowlist entry lets through only its exact (blob, rule) pair in its one repository (never the secret in another blob, a commit or tag message, another rule or repository; never a pair push protection did not ask about), is recorded only by an org owner or the operator, audited, and an unreadable allowlist refuses the pushzuppo-pushprot threat_t6_an_allowlisted_secret_passes_only_as_its_exact_blob_and_rule_in_its_repository, threat_t6_a_removed_or_unreadable_allowlist_entry_refuses_the_push; zuppo-forge threat_t6_only_an_owner_or_the_operator_changes_a_secret_allowlist_and_it_is_audited; zuppo-apid threat_t6_only_an_allowlisted_secret_blob_passes_push_protection_in_its_repository (real git pushes)t6-allowlist-exact-blob, t6-allowlist-asked-only, t6-allowlist-blobs-only, t6-allowlist-fail-closed, t6-allowlist-repo-scope, t6-allowlist-owner-only, t6-allowlist-auditedbuilt for the forge (zuppo serve, zuppo-apid); the cloud TenantDO authority keeps no allowlist, so every hit is refused there
caches scoped by who may read themzuppo-proto threat_want_stored_responses_serve_only_visible_tips; zuppo-gitd threat_want_another_repositorys_object_is_not_ourswant-proto-stored-responses, want-gitd-shared-objectsbuilt for fetch caches; CI caches do not exist yet
agent runs never get repository secretszuppo-policy ci_on_an_agent_revision_gets_secrets_only_after_a_person_approves; zuppo-grant threat_t8_an_agent_never_holds_or_uses_repository_secrets; supply::threat_t8_pull_request_workflows_get_no_secretst8-ci-secrets, t8-secrets-never-grantable, t8-pr-secretsbuilt (library and grant service; no CI runner calls ci_secrets yet)
OIDC trusted publishing——not built: Zuppo publishes nothing yet (release lanes)
SEC-T9 mutable action tags repointed (tj-actions)every CI step pinned by commit digest; downloads pinned by checksumsupply::threat_t9_ci_steps_are_pinned_by_commit_digestt9-mutable-action-tag; and the tree before this suite (27 uses: on mutable tags)built for Zuppo's own CI; the forge's CI is not built yet
SEC-T10 SAML signature bypassone XML parser; SignedInfo verified under the IdP's key, the signed element's digest matched; exactly one assertion, the signature references its parent, no DTD (each of these last three is backed by another layer: removing one alone lets no attack through); fuzzedzuppo-saml tests/attacks.rs (a_signature_by_another_key_is_refused, xsw_with_one_assertion_left_fails_the_digest, XSW 1–8, comments, duplicate ids, DTDs …); fuzz response, c14n, metadatat10-saml-signature, t10-saml-digestbuilt; the isolated sidecar is GA work (it runs in-process today)
SEC-T12 regex DoSRust regex only, with size limits, for every user pattern; no backtracking engine in the graphzuppo-code threat_t12_grep_refuses_a_pattern_over_the_compile_limit; zuppo-searchd threat_t12_searchd_path_filter_refuses_an_oversized_pattern, threat_t12_user_regex_never_reaches_a_backtracking_engine; supply::threat_t12_backtracking_regex_engines_are_bannedt12-code-grep-limit, t12-searchd-path-filter-limit, t12-searchd-regex-to-git, t12-regex-engine-banbuilt; user regexes reached git grep -E (POSIX ERE) before this suite
SEC-T13 free-compute abuseverified accounts for free CI minutes——not built (no CI runner or minutes; beta)
SEC-T14 LLM crawlers on history viewsedge caching keyed by version (a cached fetch is keyed by the object ids it wants)zuppo-proto cache_keys_are_by_resolved_oids_not_request_textt14-cache-key-versioncaching built; proof of work on deep pagination is not built (deep pages are only capped, /api/v3 page ≤ 100)
SEC-T15 Cloudflare-wide failureoff-platform read-only standby (DEP-12, HOST-4, docs/standby.md); pushes fail closed, on the primary and on the standby (which also refuses every API write); the standby reads only its own jurisdiction's DR store and orgs (EDGE-3) and serves no ref before the packs it names are copiedzuppo-ingest a_store_that_keeps_failing_commits_nothing; zuppo writes_are_refused_and_reads_pass, a_standby_serves_its_jurisdictions_dr_copy_read_only_and_is_promoted; zuppo-dr reads_nothing_of_a_store_or_org_in_another_jurisdiction, serves_the_cut_where_refs_and_their_packs_are_both_copied; simulation standbyt15-push-fails-closed, t15-standby-read-only, t15-standby-residency, t15-standby-consistent-cutbuilt: the standby and its game day (scripts/gameday.sh); a real second provider and the DNS move are external

Classes named by POL-5

ClassControls (mutants)
forged tokensprefix + checksum (tokens-checksum), kind/audience (tokens-audience), refused at the edge before any I/O (tokens-gate-malformed), the token cache keyed by the whole token's digest (tokens-gate-cache-key), an engine org's API token checked at the edge as git's (tokens-engine-edge-api), never on an unusable cached check (tokens-engine-edge-cache), a GitHub webhook delivery never verifies under an empty secret (webhook-empty-secret)
replayed tokenscodes single use (tokens-code-replay), refresh rotation (tokens-refresh-reuse), DPoP jti once (tokens-dpop-replay) for the proof's whole life (tokens-dpop-jti-life) and across a restart of the token server (tokens-dpop-jti-restart), expiry (tokens-expiry), a revoked token's cached check lapses within 5 s (tokens-gate-cache-ttl), a git token never becomes an API token (tokens-exchange-widening), nor through the refresh token its exchange answers: a grant narrowed for git refreshes to git tokens only (tokens-git-refresh-widening)
path escaperepository ids (path-repo-id), API paths (path-forge-names), pushed .git trees (path-fsck-dotgit), the staged-body key names the pushed repository (path-staged-key-repo), archive import never follows the archive's git metadata (path-archive-alternates, path-archive-config)
tenant isolationthe repository's org decides at the edge (tenant-gate-org), a forge API request goes only to its org's engine (tenant-engine-place), the engine keeps no token, grant, policy or budget beside the Durable Objects (tenant-engine-local-tokens, tenant-engine-authority-rows) and an object that cannot answer voids the step (tenant-do-authority-fail-open), another org's member gets no push advertisement on the receive path, the self-host git front (tenant-receive-role, tenant-receive-role-apid) and over SSH (tenant-receive-role-ssh), and can begin, write, read, commit or abort no push upload (SRV-6) there (tenant-pushup-role), the git front serves no cross-org counters (tenant-apid-gitd-counters), per-repository object stores (want-gitd-shared-objects), per-repository Git LFS objects (tenant-lfs-per-repo), tenant-bound sealed objects (tenant-keys-aad), one repository per grant (t1-grant-location)
allowAnySHA1InWanta stored response answers only visible tips (want-proto-stored-responses); gitd refuses a commit want not reachable from a visible ref (want-gitd-commits) and a blob/tree/tag only hidden refs reach (want-gitd-blobs); the objects API of tier-3 mounts serves trees and blobs only under a commit a visible ref reaches (want-gitd-objects-api); code RPCs by commit id likewise (want-code-oid-reachability)
hidden namespacesls-refs (hidden-ns-ls-refs), checkpoints need session:read (hidden-ns-checkpoints), the push advertisement shows a session only its own scratch refs (hidden-ns-push-advert), deepen-not cannot probe a hidden ref (hidden-ns-deepen-not), the objects API answers no hidden ref (hidden-ns-objects-api-refs), the self-host git front hides per token over smart HTTP and the objects API (hidden-ns-apid-per-token) and over SSH (hidden-ns-apid-ssh), code RPCs never resolve hidden refs (hidden-ns-code-refs)
DoS on untrusted inputgzip bodies inflate in bounded items (dos-receive-gunzip); a pushed pack's bytes must hold the objects its header counts (9 bytes an entry, then the trailer) before gix reserves for them, on every receive path (ingest::index_pack; dos-receive-pack-count); the GraphQL planner, which runs before any credential check, has a work and a depth budget and looks fragments up by name (dos-graphql-budget, dos-graphql-depth, dos-graphql-fragment-index)

The edge Worker's end to end (scripts/edge.sh check) adds, on a local workerd: a checkpoint's commit cannot be fetched by id without session:read (and can with it), the staged-body route needs the internal token, an encoded / names no repository, a Git LFS object is neither listed nor served through another repository (ING-3); forged, unknown, non-member, revoked and wrong-audience tokens were already there.

Web sign-in with the browser session

The web app takes its API token from the people session (__Host-zuppo-session: HttpOnly, Secure, SameSite=Lax, set by crates/zuppo-people) through the OAuth device flow of its own client zuppo-web (crates/zuppo/src/ui.rs, registered by every zuppo serve start): it asks for a device code, approves it with the session on the issuer's own origin, and redeems it (web/src/api/signin.ts). The cookie is no API credential: the API reads only bearer tokens (the person is passed to the OAuth endpoints alone), so no API mutation is cookie-authenticated and no CSRF token is needed beyond the decision's origin check.

ThreatControlPassing-after testsFailing-before mutantsState
another site's page approves a device code (the web client's or any other) with the person's cookiea decision is taken only with the issuer's Origin (or Sec-Fetch-Site: same-origin), and only from a full sessionzuppo threat_websession_the_web_app_takes_its_token_from_the_session_on_this_origin_only; scripts/web-session.sh (a page on another site, and a forged Origin)websession-device-decision-originbuilt
an authorization code for the web client is sent to another sitezuppo-web is public and has no redirect URI: /oauth/authorize refuses every redirect_uri for itzuppo threat_websession_the_web_app_takes_its_token_from_the_session_on_this_origin_onlywebsession-web-client-redirectbuilt
the app keeps acting after the session ended, or for the previous person after another signed in on the same browserthe token (15 min, at most an hour) is renewed only after /auth/session answers a full session of the same person; otherwise the grant is revoked and the token droppedweb signin.test.ts threat_websession_a_token_is_renewed_only_while_the_session_signs_in_the_same_person; scripts/web-session.sh (renewal past an hour on a fake clock)websession-renew-same-personbuilt
signing out of the app leaves the session (and with it a fresh token) behindsign-out revokes the app's grant (its refresh token) and ends the session (POST /auth/logout)web signin.test.ts threat_websession_sign_out_revokes_the_grant_and_ends_the_session; scripts/web-session.sh (the refresh token and access token refused after)websession-sign-out-ends-sessionbuilt

Limits: a session ended elsewhere (another tab, the operator) stops the app's access at its next renewal, up to the access token's lifetime later (15 minutes by default); the refresh token is kept in the tab's sessionStorage beside the access token (as a pasted token was), so script running in the page can read both, as it could call the API itself. The zuppo-web client asks for every scope (the person's role decides what a token does), so a device code it started that a person is talked into approving on /login (device-code phishing, as for any client) yields a token of that person; /login names the client.

P2-9: email-code sign-in, addresses and keys

POST /auth/email mails a 6-digit code to a verified address (--mail; off without it), POST /auth/email/verify signs its person in (asking for the passkey or TOTP code of a person who has one, as after a federated sign-in), and with sign-up on (--no-signup absent) creates a person for an address nobody has. The rules are crates/zuppo-people email.rs; codes live in memory only (a restart drops them) and are never logged (Mail's Debug omits the body). Adding an address uses the same codes, bound to the asking session. SSH keys a person adds (/auth/ssh-keys, crates/zuppo/src/ssh.rs) get a git-only grant in an org they are a member of (checked with the grant's own GetCaller), like zuppo admin ssh-key-add.

ThreatControlPassing-after testsFailing-before mutantsState
guessing a code10⁶ codes, 5 wrong answers kill one, 10 minutes each, one per address per 30 s and 5 per hour: at most 25 guesses an hour per address; compared in constant timezuppo-people threat_p29_an_email_code_dies_after_five_wrong_answers, threat_p29_an_email_code_expires, threat_p29_email_codes_are_rate_limited_per_address_and_per_instancep29-email-attempts, p29-email-expiry, p29-email-ratebuilt
replaying a code (a resent request, a code read later)a right code is taken, and signing in kills every other sign-in code of the addresszuppo-people threat_p29_an_email_code_answers_oncep29-email-oncebuilt
a code used in another browser (a forwarded mail, a shoulder, login CSRF with the attacker's code)the challenge is named by the asking browser's __Host-zuppo-email cookie; an address code is bound to the asking sessionzuppo-people threat_p29_an_email_code_belongs_to_the_browser_that_asked, threat_p29_an_address_code_belongs_to_the_session_that_askedp29-email-browser, p29-email-sessionbuilt
finding out who has an accountknown, unknown, suspended and shared addresses get the same answer, cookie and wrong-code answer; only a known address gets mail; the limits count every request alikezuppo-people threat_p29_asking_for_a_code_never_tells_whether_an_address_has_an_accountp29-email-enumerationbuilt
mail flooding through the sign-in formthe per-address limits, and 120 codes a minute for the whole instancezuppo-people threat_p29_email_codes_are_rate_limited_per_address_and_per_instancep29-email-ratebuilt
a stolen session adds a lasting way in (an address, an SSH or signing key)adding or removing one needs a recent proof (step_up_required), from the origin's own pages; an SSH key's grant is git-only and only in an org the person is a member ofzuppo-people addresses_are_added_by_code_made_primary_and_removed, signing_keys_are_added_listed_and_removed_by_their_owner; zuppo a_key_a_person_adds_on_their_account_pushes_over_sshbuilt

Limits: the global limit is per instance, so a flood of requests for many addresses delays everyone's codes for up to a minute; per-client limits belong to the rate limiter in front. Mail leaves over TLS (smtps, or STARTTLS that a server must offer except on loopback); what happens to it after the relay (and on the reader's device) is outside Zuppo. An address several people share (two providers verified it) signs nobody in by code. A directory's Provision sets a person's addresses to the directory's, dropping ones the person added.

WEB-8: org administration and the audit log (open side)

SsoService, ScimService, ByokService (the control plane in zuppo-forge enterprise.rs; the engine behind them is enterprise/zuppo-ee-host, its rows in the ### WEB-8 enterprise surfaces section) and AuditService (open, audit_log.rs in zuppo-forge, the chain in zuppo-apid store.rs). Every call of the three services and both audit RPCs passes the same order: org membership, agent ban, role, grant service + rate limit, Cedar, plan, then the engine. The tests below run the 14 requests, or the whole audit surface, not a sample.

ControlPassing-after testsFailing-before mutants
an agent never reaches org administration (SEC-14): AGENT_FORBIDDEN on all 14 calls and both audit RPCs, reads included; the engine and the store are never askedzuppo-forge threat_web8_an_agent_is_forbidden_every_call_and_the_engine_never_hears_of_it; zuppo-apid threat_web8_only_an_org_admin_person_reads_the_log_and_an_agent_never_doesweb8-agent-forbidden
the admin role, decided before the grant service (a writer leaves no grant decision behind); a person outside the org sees NOT_FOUNDzuppo-forge threat_web8_a_stranger_sees_nothing_and_a_writer_is_denied_before_any_grant_decisionweb8-admin-role, web8-org-membership
the org's own Cedar policy can forbid org administration (repo:admin on the org's first repository; an org with no repository has none for a rule to name, so only the fixed rules apply)zuppo-forge threat_web8_the_orgs_own_policy_can_forbid_org_administrationweb8-org-policy
plan gate (SEC-11, SEC-18): a write needs BUSINESS; a read below it answers available: false without asking the enginezuppo-forge threat_web8_a_plan_below_business_reads_unavailable_and_refuses_writesweb8-plan-gate
once-shown secrets: the SCIM token is answered once and never stored in an idempotency row nor replayed; KMS credentials are never stored, audited, shown in an ExtCall's Debug, nor part of the idempotency digestzuppo-forge threat_web8_a_once_shown_token_is_not_replayed_or_stored, threat_web8_kms_credentials_are_never_stored_audited_or_shownweb8-once-shown-token, web8-kms-fingerprint
the engine cannot forge the server's own events: grant., policy., audit., member., team., agent., billing., document., org. kinds, another org's repository and oversized details are recorded as audit.note_rejected insteadzuppo-forge threat_web8_a_note_cannot_forge_a_servers_own_eventweb8-audit-reserved-kinds, web8-audit-note-repo
the audit log is a hash chain per org (hash = sha256(prev || "\n" || record)), written in each step's transaction (SQLite and Postgres); an export recomputes it from event 1 and says whether it holds; an edited record, replaced hash, removed row or reorder breaks itzuppo-forge threat_web8_a_chain_that_holds_verifies_and_every_tampering_breaks_it; zuppo-apid threat_web8_a_tampered_row_breaks_the_chain_an_export_provesweb8-audit-chain-hash
an export is itself audited (audit.exported, appended in the read that built the file, so export_seq names a real event and a file that could not be recorded is not handed out); reading the log is not an eventzuppo-apid threat_web8_an_export_audits_itself_and_proves_its_chainweb8-audit-export-recorded
tenant isolation: an org reads and exports only its own log; another org's admin sees NOT_FOUNDzuppo-apid threat_web8_an_org_sees_its_own_log_onlyweb8-audit-tenant
a list page is at most 200 events and an export at most 20,000 events and 8 MiB of stored text; CSV cells a spreadsheet would run as formulas are defusedzuppo-forge threat_web8_a_list_and_an_export_are_bounded, threat_web8_a_csv_cell_that_a_spreadsheet_would_run_is_defusedweb8-audit-bounds, web8-audit-csv-formula
deprovisioning (ID-4) and SSO enforcement end a member's grants and tokens through one path (Admin::RevokeMemberGrants: the grant service, then the token server); a deprovisioned person's sponsored agents are removed; only the named grant, and what was narrowed from it, is sparedzuppo-forge threat_web8_revoking_a_members_grants_ends_their_tokens_and_what_they_sponsor_except_one, threat_web8_a_deprovisioned_person_also_loses_the_agents_they_sponsorweb8-revoke-member-grants, web8-revoke-spares-one, web8-deprovision-agents
the extension seam: an extension that wraps a request forwards it through ApiHandle::handle_core, which never offers it to the extension againzuppo-apid threat_web8_a_request_forwarded_through_handle_core_is_not_offered_againweb8-ext-no-recursion

Limits: a hash chain proves no row was altered, removed from the middle or reordered, but whoever can write the database can recompute the whole chain, and a removed head leaves nothing that refers to it. The export's head_seq and head_hash are the anchor a customer keeps outside the server (the audit log's signed, retention-locked segments, zuppo-audit, are the cloud's). Rows written before the chain existed (Rust Debug text) stay in the table outside every chain and are not served. Cedar is asked about the org's first repository only; an org with none is held to the fixed rules until it has one.

WEB-8 enterprise surfaces

The engine behind the three services is enterprise/zuppo-ee-host (SAML sign-in, SCIM, BYOK, the OAuth gate); its tests run a real zuppo-apid with the extension attached, the testbed's IdP, Vault-Transit KMS stand-in and DNS stub beside it, and speak HTTP and Connect to it (cargo test -p zuppo-ee-host --test threat). The SAML validator's own refusal classes are SEC-T10 above; the rows here are what the host adds around it.

ControlPassing-after tests (zuppo-ee-host tests/threat.rs)Failing-before mutants
an assertion the validator refuses is a failed sign-in, whatever refused it: wrong key, expired, not yet valid, wrong audience, wrong destination, unsigned, unsolicited, through the whole server path; the test outcome records the validator's code and never passesthreat_saml_every_refusal_class_fails_through_the_server_patht10-ee-saml-refusal
a test sign-in is the admin's: only the one-time nonce StartSsoTest minted marks a flight as a test (anyone may add ?test= to the URL), and require_sso needs a passed test of exactly this provider (a changed provider clears it)threat_sso_test_flow_needs_the_nonce_the_admin_started, threat_sso_require_needs_a_passed_test_of_this_providert11-ee-sso-test-nonce, t11-ee-sso-require-test
SSO enforcement: /oauth/authorize and /oauth/device answer 403 sso-required to a person of an enforcing org who has no SSO session of that org's connection (cookie __Host-zuppo-sso: HMAC-signed, expiring, bound to the provider revision and to a person who is still active), and only to such a person: an anonymous request and other orgs' people are untouched (no cross-tenant DoS); turning enforcement on ends every other member's grants and keeps the caller's own; operator tokens stay (break-glass)threat_sso_gate_refuses_a_person_of_an_enforcing_org_without_an_sso_session, threat_sso_enforcement_never_touches_anonymous_requests_or_other_orgs_people, threat_sso_forged_session_cookie_is_refused, threat_sso_session_expires, threat_sso_session_does_not_survive_a_provider_change, threat_sso_enforcement_ends_every_other_members_grantst11-ee-sso-gate, t11-ee-sso-gate-scope, t11-ee-sso-session-mac, t11-ee-sso-session-expiry, t11-ee-sso-session-provider, t11-ee-sso-enforce-revoke
who may sign in: only a person SCIM provisioned, or an existing member whose email is on a domain the org proved by DNS TXT; a deprovisioned person neverthreat_sso_a_deprovisioned_or_unknown_person_cannot_sign_in, threat_sso_email_link_needs_a_verified_domaint11-ee-sso-signin-suspended, t11-ee-sso-link-domain
every SCIM request needs the bearer token (constant-time digest compare, zuppo-scim); a disabled directory is 404; refused credentials are audited at most once a minute per org; the token is shown once and only its last four characters are ever read backthreat_scim_requires_the_bearer_token_and_a_disabled_directory_is_404, threat_scim_refused_credentials_do_not_flood_the_audit_log, threat_scim_token_hint_is_four_characters_and_the_token_is_never_read_backt11-ee-scim-bearer, t11-ee-scim-enabled, t11-ee-scim-audit-flood, t11-ee-scim-token-hint
deprovisioning (ID-4): a SCIM delete or active=false suspends the identity first (no sign-in, no session), removes the member and ends their grants and the agents they sponsor, within the minute (immediately here); the identity provider cannot pick an existing member's forge handle (a hash of the org and userName is part of it), so it cannot clobber or remove onethreat_scim_deprovision_ends_the_role_the_grants_and_the_agents_they_sponsor, threat_scim_cannot_claim_an_existing_members_handlet11-ee-scim-deprovision-revoke, t11-ee-scim-handle
BYOK: the customer's KMS credentials are write-only (sealed under the platform KEK at rest, never returned, never audited); a key the customer disables or destroys makes the org's sealed rows unreadable within the open-key TTL, and SCIM and SAML, which run from memory, stop with them (fail closed: never a fall back to the platform key)threat_byok_credentials_are_sealed_at_rest_and_never_returned_or_audited, threat_byok_revoked_key_makes_the_sealed_rows_unreadable_within_the_ttl, threat_byok_revocation_stops_scim_and_samlt18-ee-byok-credentials-sealed, t18-ee-byok-open-ttl, t18-ee-byok-fail-closed
tenant isolation: an org's settings, domains, directory, token and sessions are its own; another org's admin sees NOT_FOUNDthreat_tenant_org_b_is_invisible_to_org_a (and tests/controls.rs org_a_cannot_see_or_change_org_b)t11-ee-tenant-sso-row
the SSO configuration carries an etag: a write with a stale or missing one is refusedthreat_sso_etag_is_enforced_on_every_writet11-ee-sso-etag
a SCIM handle carries 128 bits of a hash of the org and userName: another org's identity provider cannot grind a userName onto a person of this org (a SAML sign-in as that handle would be a session as them)src/scim.rs threat_tenant_scim_handle_cannot_be_ground_to_another_orgs_persont11-ee-scim-handle-width
BYOK tenant isolation: each org's data key is opened through its own keyring and its own BYOK machine, so a slow or tarpitting customer KMS, even one triggered by anonymous /auth/saml/{org} or /scim/v2/{org} requests, holds up that org only, never another org's keysthreat_tenant_byok_one_orgs_hanging_kms_does_not_stall_another_orgt18-ee-byok-org-keyring, t18-byok-tenant-driver

Limits: the OAuth endpoints name no org, so the SSO gate attributes a request to an org only through the person: an SSO session, or the signed-in person a people layer passes with the request (ExtRequest::principal), who is a known identity of an org that requires SSO (SCIM-provisioned, or linked by a verified-domain email). Only that person is refused (403 sso-required) without a session of that org's connection; an anonymous request and every other org's people pass through unchanged (the server itself refuses a consent without a person), so one org's admin cannot break OAuth sign-in for another org. A member of an enforcing org who was never linked to an identity is not recognised by the gate. SCIM requests are not rate limited here (the forge's limiter sits in front of the RPCs only). The IdP's metadata is fetched without redirects, capped at 256 KiB, over https to public addresses unless ZUPPO_EE_ENDPOINTS=custom. The SSO session cookie is __Host-zuppo-sso (Secure) for an https issuer and zuppo-sso (no prefix, no Secure) for an http:// issuer. Deleting and re-adding an SSO configuration restarts its revision at 1, so SSO sessions of the removed provider live on until their TTL (open). A tarpitting customer KMS still ties up its own org's requests for up to the 30 s operation deadline each (no per-org failure backoff yet).

HS-1: hosted sandboxes

A sandbox runs code the forge did not write (an agent's run, a reviewer, a preview of a change, Quick Checks) on a runtime the forge drives: Docker on a self-host (zuppo-sandbox docker.rs: runc, or gVisor with runsc) or a Cloudflare Container per sandbox driven by the TypeScript SessionDO (crates/zuppo-sandbox/session-do). The forge's side is zuppo-hosted runtime.rs (the launch spec and its secret-less check) and zuppo-forge hosted.rs; the preview path is zuppo-apid http.rs. The proof on a real runtime is scripts/sandbox.sh check (Docker on Colima; the SessionDO under wrangler dev --local).

ControlPassing-after testsFailing-before mutants
no secret enters a sandbox (R8, SEC-9): its environment is exactly the fixed ZUPPO_* names valued with resource names, ids and the commit, and no value holds its credential; the forge and every driver check it before anything startszuppo-hosted threat_hs1_a_launch_that_would_carry_a_secret_into_the_sandbox_is_refused; Docker: zuppo-apid threat_hs1_a_run_finds_no_secret_and_reaches_the_forge_only_through_the_outbound_layer, zuppo-sandbox secret_less_a_preview_holds_no_secret_and_reaches_only_its_proxy (both --ignored, scripts/sandbox.sh)hs1-launch-secret, hs1-launch-env-names
the sandbox's credential is narrowed from its creator's grant (API for hosted review/check, git otherwise), held only by the outbound layer (the self-host proxy sidecar's environment; the SessionDO's storage) and revoked when the sandbox ends; a preview gets nonezuppo-forge threat_hs1_a_sandbox_holds_no_secret_and_its_credential_dies_with_it, a_preview_runs_its_revision_with_no_credential_and_a_persons_run_gets_theirs, threat_hs2_reviewer_findings_are_advisory_onlyhs1-credential-revoked
egress reaches the forge (through the outbound layer) and the allow list's public hosts only: no loopback, private, link-local (cloud metadata), CGNAT or ULA address, numeric-notation host or .internal/.local name, checked at CreateSandbox, in the launch, and on the resolved address in the proxyzuppo-hosted threat_hs1_egress_never_reaches_a_private_or_local_service; zuppo-forge threat_hs1_egress_to_a_private_or_local_address_is_refusedhs1-egress-private, hs1-forge-egress
an IPv4 address carried in IPv6 (NAT64 64:ff9b::/96, 6to4 2002::/16) is judged as that address, and ::/96 and local-use NAT64 64:ff9b:1::/48 are never public, in the allow list (Rust, the SessionDO's port) and on the resolved address in the proxy: a translator on the outbound layer's network would deliver them to a private or metadata addresszuppo-hosted threat_hs1_egress_never_reaches_a_private_address_carried_in_ipv6; session-do test/rules.test.mjs (allow_ok: an IPv4 address carried in IPv6)hs1-egress-carried-v4
the self-host sandbox container is on its own --internal network (its proxy is the only peer), unprivileged (--cap-drop ALL, no-new-privileges, uid 1000), capped (vCPUs, memory without swap, 512 pids), with no host mount, port or socketzuppo-sandbox threat_hs1_the_sandbox_container_is_isolated_and_holds_no_secret; Docker: caps_each_size_is_capped_unprivileged_and_on_its_internal_network (--ignored)hs1-docker-caps, hs1-docker-network
a preview opens for its org's people and for the agent whose grant it derives from, never another agent or a stranger, and not once it endedzuppo-forge threat_hs1_a_preview_opens_only_for_its_org_and_its_granths1-preview-grant
a preview request carries none of the visitor's credentials into the sandbox (Authorization, Cookie, Proxy-Authorization), and its answer cannot act as the forge: no Set-Cookie on the forge's origin, CSP sandbox without allow-same-origin (an opaque origin: no cookie, no same-origin API call, no service worker), nosniffzuppo-apid threat_hs1_a_preview_request_carries_no_visitor_credential_and_its_answer_cannot_act_as_the_forgehs1-preview-strip, hs1-preview-origin
the SessionDO (TypeScript) keeps the same rules: it re-runs the launch check and the egress rule (ported, tested against the Rust vectors), holds the credential in its own storage only, tells which session a container request belongs to from the intercept's platform-set props (never from anything the container sends: one session cannot use another's credential), strips the visitor's credentials from a preview, and refuses every control route without the constant-time-compared bearersession-do test/rules.test.mjs (allow_ok: the Rust vectors, Launch::check: the Rust vectors); local stack test/local.test.mjs (secret-less: …, isolation: each session reaches the forge with its own credential only, the control token is required on every route, an empty CONTROL_TOKEN refuses everything)— (node's test reporter is not one threat.sh reads; the rules' Rust originals carry the mutants above)

Limits: gVisor is checked at the argument level only (--runtime runsc; this machine's Docker has no runsc, and the shared Colima daemon is not reconfigured); the Firecracker microVM and enableInternet: false are Cloudflare's and are proven there, not here: on the local stack (wrangler dev --local) a container still reaches the Docker host directly, which local.test.mjs records as a limitation, not a pass. On Cloudflare the outbound handler checks names only (a Worker has no DNS API), the Containers API has no pids limit, and HTTPS to an allowed host goes as plain HTTP to the handler, which upgrades it (no CONNECT). A self-host sandbox's disk is not capped (Docker needs overlay2 on xfs with project quotas for --storage-opt size). HTTPS through the self-host proxy is an opaque CONNECT tunnel to an allowed host, so no credential is injected into it. Previews share the forge's origin under /_preview/; the CSP sandbox answer is what keeps them from acting as it (a separate preview origin is the stronger shape). An injected credential is only as private as its host: one that reflects request headers back (an echo service) shows it to the sandbox, so operators inject for API hosts that do not.

HS-2: hosted reviewer and Quick Checks

The sandbox image owns the reviewer/check entrypoint. Repository code remains untrusted; only base-commit REVIEW.md and .zuppo/sandbox/{review,quick-checks}.json configure it. No keys are in the workspace. Every read, finding and check report goes through the existing authorized API (grant envelope, tenant isolation, rate limit, taint/Rule of Two, labels and audit).

ControlEvidenceFailing-before mutant
F3: hosted findings are agent opinions only; an open blocker changes no mergeability gate, counts no approval, and its grant cannot approve, mark ready or land; scorecards remain advisoryzuppo-forge threat_hs2_reviewer_findings_are_advisory_onlyexisting F3 grant/policy mutants; hs2-agent-only
no person's authority is lent to untrusted checks; API credential is narrowed to read + check, reports remain DECLARED, no preview is exposed; TTL ≤900 seconds with normal budgets and revocationzuppo-forge threat_hs2_quick_checks_are_bounded_and_never_borrow_a_persons_authority; Docker zuppo-apid threat_hs2_quick_checks_run_in_the_sandbox_and_report_to_the_real_forgehs2-agent-only, hs2-check-window
malicious revision rules/config never drive the reviewer; one bounded model call carries no key and creates findings only; malformed model locations/confidence and malformed check definitions fail closednode --test crates/zuppo-sandbox/tests/hosted.test.mjs reviewer + untrusted-output casesprotocol fixtures assert the consumed base commit
affected lint/typecheck/unit only; command failures produce structured repros; logs bounded and runaway process groups terminatedsame Node suite Quick Checks + command deadline cases; Docker test above uses real CheckServicehs2-check-window plus executable command deadline assertions

The normal suite makes no real model calls. The explicit hosted_reviewer_real_model e2e is ignored and excluded from scripts/sandbox.sh; it requires a BYO Anthropic API key, Docker and external network, uses one request with 1024 output tokens and a 180-second sandbox cap. HS-1's local/cloud isolation limitations still apply. Quick Checks are not privileged CI: their agent reports never fulfill required checks. Model findings may be wrong; people decide.

The forge engine behind the edge (cloud API)

SPK-7: the connectrpc server does not build for wasm32, so in the cloud the forge API runs in the engine container (zuppo serve, one per jurisdiction) behind the edge Worker (crates/zuppo-edge/src/engine.rs, zuppo_edge_core::engine). The engine runs with --authority do:<internal API> (zf-doauth, captain's long-term target, option b of 2026-11-14): its forge core takes tokens, grants, policy and budgets from the AuthDO, the org's TenantDO and the sponsor's BudgetDO (zuppo_apid::DoAuthority, through zuppo_forge::Authority) and refs from the RepoDO, keeps none of them and issues no token; the edge checks every forge token of an engine org's request with the AuthDO exactly as its git gate does, before any container is touched.

ThreatControlPassing-after testsFailing-before mutantsState
an API request for one org reaches another org's or another jurisdiction's engine, or an org on the Durable Object plane gets an API through the home enginethe edge places a request by the org it names (path or Connect message) in the directory: an engine org goes only to its jurisdiction's engine, an unknown or Durable-Object-plane org is 404 with no container touchedzuppo-edge-core threat_engine_requests_go_only_to_their_orgs_engine, paths_name_their_org, connect_messages_name_their_org; scripts/edge.sh enginetenant-engine-placebuilt
a missing, forged, expired, revoked or wrong-audience token on an engine org's API or git reaches the containerthe edge checks it with the AuthDO (Verify: the git gate's audiences, its 5 s positive cache never past a token's expiry) before the directory or a container: 401 at the edge (git with the Basic challenge, the API as an unauthenticated problem); only the engine's public paths (health, OpenAPI, /.well-known/…, sign-in, OAuth) take nonezuppo-edge-core threat_engine_tokens_are_checked_at_the_edge, threat_engine_requests_take_the_git_gates_audiences_and_the_apis; scripts/edge.sh engine (api_tokens_checked_at_edge, git_tokens_checked_at_edge)tokens-engine-edge-api, tokens-engine-edge-cachebuilt
the engine keeps a second token, grant, policy or budget authority beside the Durable Objects (tokens it issued that the edge cannot check, grants the git gate does not see)DoAuthority steps the objects' cores and stores none of their rows (keep false); a row store still holding authority rows refuses to start with --authority (Forge::restore_with); every token is the AuthDO's (OAuth, bootstrap, issue_grant), the role every authorization uses is the TenantDO's directory (membership written through first)zuppo-apid threat_engine_keeps_no_token_and_acts_on_the_objects_effects; zuppo-forge threat_a_remote_authority_keeps_its_rows_and_the_forge_restores_the_rest; scripts/edge.sh engine (engine_keeps_no_authority_rows); scripts/rfc212-day.sh cloudtenant-engine-local-tokens, tenant-engine-authority-rowsbuilt
a Durable Object that cannot answer (unreachable, a timeout, a broken answer) lets a call throughevery failed call answers fail-closed (a refusal, PermissionDenied, nothing found) and is reported once; the driver voids the whole step (no row, reply or I/O of it goes out; the core is rebuilt from the committed rows; calls in flight are UNAVAILABLE, retryable) and keeps servingzuppo-apid threat_a_failed_authority_call_is_refused_and_voids_the_step; scripts/edge.sh engine (unreachable_objects_void_the_step)tenant-do-authority-fail-openbuilt
a git-lfs client is sent to the engine's internal address (around the edge)under zuppo serve (apid in process) LFS batch actions point at the issuer, never at the request's Host; only apid's own git listener answers with its Hostzuppo-apid threat_lfs_actions_point_at_the_issuer_behind_an_in_process_frontlfs-origin-issuerbuilt
one caller's code read kept at the edge is served to another caller, or a read at a branch is served stalethe engine marks only a Connect GET read at commits named by id private, max-age=3600, immutable (zuppo_forge::pinned: the answer names the same commits the request did); the edge keeps only such answers, under the URL plus the SHA-256 of the caller's Authorization, Cookie, field mask and Accept (kept_key; never a DPoP-bound call), so an answer goes back only to the credentials the engine authorized it for, for at most the hour; every other read (a branch, a tag) goes to the engine, unless its client opts in to an early answer (next row)zuppo-edge-core threat_kept_answers_are_keyed_by_their_callers_credentials, only_one_callers_immutable_answers_are_kept; zuppo-forge only_reads_at_commits_named_by_id_are_pinned; zuppo-apid code_reads_carry_highlighting_and_only_reads_at_a_commit_are_pinned; scripts/edge.sh engine-owntenant-edge-kept-keybuilt; with ENGINE_AUTHORITY=engine a revoked token still gets the answers it was given within the hour (the edge cannot check it), with do the edge checks the token first
an early branch view (zf-edgeexact) shows a caller another caller's answer, where a name it may not read points, or a stale commit after the engine has answeredonly a request with zuppo-early: 1 (the web app) is answered early (refmap::opted_in), marked zuppo-early: served, and the client repeats it to the engine without the header and shows the engine's answer when it differs; a read at a name is answered from what the engine gave the same credentials for the same request at the commit the map gives (refmap::at_key: the caller's kept_key plus the commit; a shell read's last answer last_key, for 10 minutes), so no answer crosses callers or names; the map holds only names every ref they can resolve to is a published branch or tag (refmap::mappable: never a hidden namespace, pseudo-ref, expression or change revision), the engine publishes every committed ref transaction of both ref stores to /_edge/refmap (bearer ZUPPO_REFMAP_TOKEN) and each moved ref retires every name that resolves to it (refmap::invalidated), and a push or forge write through a colo retires that colo's older entries at once (refmap::usable)zuppo-edge-core threat_answers_at_a_commit_are_kept_per_caller_and_name, threat_only_opted_in_requests_are_answered_early, threat_every_mapped_name_is_retired_by_the_refs_it_resolves_to, threat_a_write_through_the_colo_retires_older_entries; scripts/edge.sh engine-own (early_answers_never_served_to_other_credentials, push_through_the_edge_retires_the_map, push_to_the_engine_retires_the_map, engine_ref_write_retires_the_map)tenant-edge-early-at-key, tenant-edge-early-opt-in, hidden-ns-edge-refmap-names, tenant-edge-refmap-retire-short, tenant-edge-write-markbuilt; the map is Workers KV: a move made through another colo reaches this one within about 60 s, meanwhile an early answer there is replaced by the engine's when the client's check returns

Limits: the engine sees the edge's address as every client's, so its per-client-address partition of anonymous requests (IFC-17) is one partition behind the edge (as for a self-host behind a reverse proxy); a request naming no org (OAuth, sign-in, GetOperation, a binary protobuf message) goes to the home engine (ENGINE_HOME), which asks the objects of whatever org it names, in that org's jurisdiction. The engine asserts the signed-in person of an OAuth request to the AuthDO over the internal API (auth:step), as it did to its own token server; only holders of the internal API's bearer can. DPoP-bound tokens are refused on the cloud (no proof crosses the internal API: the AuthDO's check, as on git); self-host keeps them. A revoked token works at most 5 s longer where a positive check of it is cached (the edge's isolate, the engine). The engine reuses an org's grant records, roles and org policies for as long: its own writes to the org end them at once, a change it did not make (another engine's, an expiry) shows within 5 s, and every grant's authorization is still the TenantDO's own step. A step voided after an object accepted a write leaves that write (a grant registered or a token issued whose answer never left: nobody holds it; points debited for a call with no effect), and the client's retry runs again. With ENGINE_AUTHORITY=engine (the engine is its own authority; zuppo.dev) the edge checks no token of an engine org's API or git request: it forwards git requests that carry credentials and every API request, and the engine refuses the rest with the same 401, so the rows above that cite the edge's check hold for do only. An unset or unknown value is do (checked at the edge) or a configuration error, never engine.

P2-11: undoing a stack operation

StackService.UndoStackOperation writes new revisions that put every change an operation touched back on its earlier revision. The rules are the change engine's (zuppo-change oplog), so the ChangeDO and the self-host engine enforce the same ones; the forge first asks the grant service for change:write on the next revision refs.

ThreatControlPassing-after testsFailing-before mutants
an agent reverts a person's, another agent's, a landing's or the merge queue's workan agent undoes only operations made through the same agent for the same principal; a person undoes anyzuppo-change threat_p211_a_person_undoes_anything_and_an_agent_only_its_own_and_never_on_git; zuppo-forge threat_p211_an_agent_undoes_its_own_restack_but_not_a_persons_pushp211-undo-own-operation
an agent undoes on a repository whose people chose git (.zuppo/vcs.yml engine: git)there undo needs a person (AGENT_FORBIDDEN)zuppo-forge threat_p211_on_a_git_engine_undo_needs_a_personp211-undo-git-person
an undo rewrites what landed or sits in the merge queuea touched change that is landed or queued refuses the undo, whoever askszuppo-forge threat_p211_an_undo_touching_a_landed_change_is_refused_with_the_reasonp211-undo-landed
an undo of an old operation silently drops newer work (someone's later push or restack)an undo applies only to the stack exactly as the operation left it (base, open changes, revisions)zuppo-change threat_p211_refuses_landed_queued_creating_and_moved_on_operationsp211-undo-moved

Limits: an undo writes no new content (each restored revision is a copy of one the change had), so it runs no content check of its own; the content was checked when it was first written. Who may undo is decided on the actor of the operation's record: an agent's undo of its own undo is its own operation, a person's undo of the agent's is not.

P2-1: merge on green (D6 b, F3)

Merge on green lets the forge (app_zuppo) put a stack into its merge queue by itself once a person approved every open change, every one is ready and green on its required checks, and the stack is within the repository's limits (MergeQueueService.UpdateQueueSettings, zuppo-forge green.rs). The approval it rests on is a person's: the change engine's landability check refuses a stack that lacks one (F3), whoever asks.

ControlPassing-after testsFailing-before mutants
only a person with repo:admin (the Admin role; never an agent) turns it on, changes its limits or turns it off, against the settings' etagzuppo-forge threat_mog_only_a_person_with_repo_admin_changes_merge_on_green_against_its_etagmog-repo-admin, mog-settings-etag
nothing is enqueued while it is off, nor a stack over its line or file limit, touching a protected path or by the wrong authors, nor one a person has not approvedzuppo-forge threat_mog_never_enqueues_while_off_unapproved_or_outside_its_limitsmog-off, mog-eligible
revocation: turning it off takes every stack it enqueued that is not landing out of the queue; a stack that left the queue it put it in is not put back (a person enqueues it)zuppo-forge threat_mog_turning_it_off_takes_its_stacks_out_and_they_are_not_put_backmog-revoke, mog-once
a spot check is a person's change:merge (agents refused); a revert verdict names an open change of the same repositoryzuppo-forge threat_mog_a_green_stack_enqueues_itself_and_a_person_settles_its_spot_checkmog-spot-person

Limits: the queue remembers a stack's last entry for its history (50 lands); a stack that left the queue longer ago than that is eligible on green again at its next review or green check run. A pending spot check outlives that history until a person settles it.

P2-12: several agents on one stack

StackService.ListStackEditors shows who is editing a stack now; ChangeService.ClaimChange and ReleaseChange keep advisory claims; another agent's push of a claimed change that does not build on its current revision is kept aside as a DivergentChange for DecideDivergentChange. The claim and divergence rules are the change engine's (zuppo-change claims, engine::claims); presence is the forge's, from the stack's own org's grants and the engine's revisions and claims. Claims and divergence never stop a person: a person's push goes through and a person ends any claim.

ThreatControlPassing-after testsFailing-before mutants
presence leaks who works in another tenant's repository, or shows an agent whose access endedthe list is read only by a caller authorized to read the repository (NOT_FOUND otherwise, before any lookup); only sessions whose live grant in the stack's own org names the stack, recent pushers (an agent only while its grant is live) and live claim holders appearzuppo-forge threat_p212_presence_shows_only_live_grant_holders_of_the_stacks_own_orgp212-presence-see-repo, p212-presence-live-grant
another agent session takes over a change an agent is editinga live claim has one holder: claiming it is refused (ALREADY_EXISTS)zuppo-forge threat_p212_two_sessions_edit_one_stack_and_a_divergent_push_waits_for_a_personp212-claim-holder
an agent ends another session's claiman agent releases only its own claim (AGENT_FORBIDDEN)zuppo-forge threat_p212_an_agent_does_not_release_another_sessions_claimp212-release-own
an agent silently overwrites the revision a claim holder is working onits push of the claimed change that does not build on the current revision becomes a divergent change; the revision stayszuppo-forge threat_p212_two_sessions_edit_one_stack_and_a_divergent_push_waits_for_a_personp212-divergent-never-overwrites
an agent decides its own divergent changeonly a person decides (PERMISSION_DENIED)zuppo-forge threat_p212_two_sessions_edit_one_stack_and_a_divergent_push_waits_for_a_personp212-decide-person

Limits: a claim is advisory. "Builds on" is git ancestry for a push (the current revision's commit is the push's base or a commit under the pushed one) and the base revision for an API write (CreateRevisionFromFiles/Patch, whose stale base is refused as STALE_BASE already); jj's own predecessor record of a rewrite is not visible to the forge, so a push that rewrites the current revision without descending from it is divergent while someone else holds the claim.

P2-5: the agent registry and the org's guardrails

GrantService.RegisterAgent and UpdateOrgPolicy are an org owner's or admin's writes (authorize_admin: a person, the admin role, repo:admin, the org's Cedar policy); ListAgents and GetOrgPolicy are reads of any member or agent. The guardrails are the grant service's (zuppo-grant), so the TenantDO and the self-host engine enforce the same ones on every agent request: daily limits are day buckets on the agent's chain (one agent; every agent together), working hours and a pause are refused before any right, and auto-pause counts an agent's refusals per clock hour.

ThreatControlPassing-after testsFailing-before mutants
a writer or an agent registers an agent, unpauses itself or raises its own role capRegisterAgent needs a person with the admin role (an agent's token is AGENT_FORBIDDEN, even for itself); a role cap above MAINTAINER is refusedzuppo-forge threat_p25_registry_and_policy_writes_are_an_admins_alonep25-register-admin, p25-agent-role
re-registering an agent moves it to another sponsor (the caller), revoking or capturing its grantsan existing agent keeps its sponsor (F2); only a new one is sponsored by the person registering itzuppo-forge an_owner_registers_an_agent_that_acts_once_grantedp25-register-sponsor
a writer or an agent loosens the org's guardrails or agent scopesUpdateOrgPolicy needs a person with the admin role; never-grantable scopes stay refused whatever it says (SEC-14)zuppo-forge threat_p25_registry_and_policy_writes_are_an_admins_alonep25-policy-admin
an agent spends past the org's daily limitthe daily limits are buckets on every agent grant's chain, debited with its hourly ones; GetQuota reports the tightestzuppo-grant threat_p25_daily_guardrails_cap_an_agent_and_all_agents_per_utc_day; zuppo-forge a_daily_limit_persists_and_is_enforced_by_the_grant_quotap25-daily-link
a paused agent, or one outside the org's hours, keeps actingrefused before any right (PERMISSION_DENIED, Retry-After at the next opening)zuppo-grant threat_p25_auto_pause_stops_an_agent_whose_requests_are_mostly_refused, threat_p25_outside_the_orgs_hours_an_agent_waits_for_them_to_openp25-paused, p25-hours

Limits: working hours are a fixed UTC offset (no daylight saving). Auto-pause judges refused requests, the failure the grant service sees, not a run's outcome; its hour's tally is kept in memory, so a restart starts the hour over. Its notice to the sponsor goes where every grant notice goes today (the operator log); the agent shows paused in the Fleet.

P2-7: CI ingestion and merge queue controls

CheckService.UploadReport turns a SARIF log into the repository's security alerts and an LCOV report into its coverage (both in the repository's documents), CheckService.CancelCheckRun completes a run as cancelled, and MergeQueueService.SetQueuePaused and PrioritizeStack pause the queue and move a stack to its front.

ThreatControlPassing-after testsFailing-before mutants
an agent hides security alerts by uploading a clean SARIF log, or rewrites the coverageagents never upload a report (AGENT_FORBIDDEN), as they never write documents; CI (an app) or a person does, with check:writezuppo-forge threat_p27_an_agent_never_uploads_a_reportp27-upload-agent
an agent stops CI's run of a check it would failan agent cancels only its own runs; a cancelled run never satisfies a required checkzuppo-forge threat_p27_a_cancelled_run_completes_as_cancelled_and_an_agent_cancels_only_its_ownp27-cancel-own
a writer or an agent stalls every landing (pause) or jumps the queuepausing and moving to the front need change:merge (never an agent's) and a maintainer's rolezuppo-forge threat_p27_only_a_maintainer_pauses_or_reorders_the_queuep27-queue-maintainer

Limits: cancelling does not stop the CI job itself; CI learns of it from the run's check_completed event. A SARIF log's alert set replaces only the tools that ran in it, so a person with check:write can still clear one tool's alerts by uploading its clean log; the upload is audited as document.put.

P2-3: the integrations hub

Settings › Integrations is the org's integrations document (DocumentService: owners and maintainers write it, agents never read or write it). The forge validates it on every write (zuppo-forge integrations.rs) and acts on one thing in it: a new session of an agent with a runtime records the runtime's model. No field holds a key.

ThreatControlPassing-after testsFailing-before mutants
a model, runner or provider key pasted into the hub is stored where every org member reads ita value that looks like a credential (a known key prefix, or a Zuppo token by its checksum) is refused, and the refusal does not repeat itzuppo-forge threat_integrations_a_value_that_looks_like_a_key_is_refused_and_not_repeated, threat_integrations_a_key_put_in_the_document_is_never_stored_or_auditedp23-integrations-key

Limits: only known key prefixes are recognised (push protection's scanner is not in the wasm forge); a key without one, such as a bare 32-character string, is not caught. The hub asks for no key anywhere, so a key reaches it only by being pasted.

Fuzzers (untrusted bytes)

ParserTarget
pkt-line, protocol v2 requests, the upload sessionzuppo-proto/fuzz: pktline, v2_request, upload_session, parsers, fetch_response, manifest_codec
receive-pack (commands, push options, pack header)zuppo-receive/fuzz: receive_session
pack and index reading (gix-pack, under push protection's scan)zuppo-gitd-receive/fuzz: index_pack; objects: zuppo-ingest/fuzz ingest_session; trees, .gitmodules, secrets: zuppo-pushprot/fuzz pushprot_session
archive importzuppo-github/fuzz: archive_reader (the JSON members); zuppo-apid/fuzz: archive_extract (the tar)
/api/v3 GraphQLzuppo-api-v3/fuzz: gql_plan, exchange
token formats, DPoP, OAuth HTTPzuppo-auth/fuzz: token_parse, dpop_proof, http_request
edge routing, credentials, the gatezuppo-edge-core/fuzz: route, gate
Git LFS batch JSON and the object PUT check; push-upload begin/meta/part arithmeticzuppo-edge-core/fuzz: lfs, pushup
GitHub webhook signature and delivery normalizationzuppo-github/fuzz: webhook
PROXY protocol v1/v2 headers and the trusted-proxy list (SSH behind Spectrum)zuppo-proxyproto/fuzz: decode
SAML, SCIM, SSH certificates, attestations, the audit logenterprise/zuppo-saml/fuzz, enterprise/zuppo-scim/fuzz, zuppo-sshca/fuzz, zuppo-attest/fuzz, zuppo-audit/fuzz

Limits the suite records

  • want checks for blobs, trees and tags use git rev-list --objects <hidden> --not <visible>, which marks only the boundary's trees uninteresting: an object also reachable from older visible history can be refused (fails closed). A commit or object no ref reaches is refused for commits (as C's v0 check), served for blobs and trees (partial clones fetch them by id; their ids come only with their trees).
  • A have line still answers whether an object exists (C does the same); the object is not sent.
  • deepen-not on a stateful v0/v1 stream (SSH, not served before beta) is C's.
  • Self-host only: the receive-pack advertisement on the API server's git front lists the repository's refs to any member who may push, hidden namespaces included (names and ids; their objects stay unfetchable). The cloud's push advertisement is the edge's and hides them (hidden-ns-push-advert).
  • Device user codes (20^8, 10 minutes) have no attempt limit in the token server; only a limiter in front of /oauth/device would bound guessing (open). The self-host login page follows a return_to only when the browser resolves it to this origin.