Skip to content

feat(den): disable managed Models for DPA organizations - #4626

Merged
OmarMcAdam merged 2 commits into
devfrom
dpa-opt-out
Sep 8, 2026
Merged

OmarMcAdam merged 2 commits into
devfrom
dpa-opt-out

Conversation

@OmarMcAdam

Copy link
Copy Markdown
Member

Summary

  • Store a strict boolean dpaSigned in existing organization metadata, with an audited allowlisted-platform-admin set/unset operation and reserved-key protection.
  • Fail closed at managed inference admission and immediately before upstream dispatch; guard provisioning, repair, checkout, late billing activation, and managed provider delivery without blocking customer-owned Gateway credentials.
  • Preserve unrelated metadata under concurrent writes and retain subscriptions, transaction history, and existing keys.

Verification

Passed on PR head d85ed4b4f after rebasing onto current dev:

  • pnpm evals:pr specs/managed-models-dpa.test.ts: 1 passed, 0 failed/skipped; 17 observable assertion groups. Placement: local (testkit resolvePlace; isolated app-less Den and inference). Independent upstream witness proves denied requests dispatch nothing; synthetic-only transport records zero external HTTP attempts.
  • pnpm evals:pr specs/team-organization-admin.test.ts: 1 passed, 0 failed/skipped.
  • Den and inference TypeScript checks passed.

Per-test testkit evidence is published in the PR comments. See docs/pr-proof/dpa-opt-out.md for the initial verification record and clean-control diagnosis of existing broader eval typecheck/ratchet failures.

Scope and operational limits

  • No schema migration, production organization mutation, live-key revocation, cancellation, refund, or deployment performed.
  • The final uncached policy read is dispatch admission, not a distributed cancellation/drain barrier; already-admitted or transmitted requests are not canceled.
  • BYOK boundary proof uses Den-delivered configuration with an HTTP client, not a full Gateway/OpenCode runtime. Desktop/Web/automation runtime reconciliation is not fully certified here.
  • Safe staged rollout and rollback precautions: docs/features/managed-models-dpa.md.

@vercel

vercel Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

4 Skipped Deployments
Project Deployment Actions Updated
openwork-app Ignored Ignored Preview Sep 8, 2026 7:02pm UTC
openwork-den Ignored Ignored Preview Sep 8, 2026 7:02pm UTC
openwork-diagnostics Ignored Ignored Preview Sep 8, 2026 7:02pm UTC
openwork-landing Ignored Ignored Preview Sep 8, 2026 7:02pm UTC

@OmarMcAdam

Copy link
Copy Markdown
Member Author

Test evidence — team-admin-grants-are-live-scoped-protected-and-cleared-across-scim-lifecycles — ✅ passed

SHA 5157a5c · engine v1

✅ passed · 4 expectations passed · 0 failed · 0 pending

screenshots not attached (gh < 2.99; run brew upgrade gh)

verdict passed · 0 user observations · 0 probes · steps 0/0

ℹ️ ASSERTION — 1. Live team grants preserve direct roles and other grants

The original bearer gains and loses Admin without re-login; stored member role remains member, a second team survives the first removal, direct Admin survives team revocation, and control stays unprivileged.

  • ✅ PASS Live team grants preserve direct roles and other grants — The original bearer gains and loses Admin without re-login; stored member role remains member, a second team survives the first removal, direct Admin survives team revocation, and control stays unprivileged.

ℹ️ ASSERTION — 2. Admin-team invitation and raw route bypasses are denied

A direct Admin cannot refresh or cancel the privileged pending invitation; raw team/invitation writes and leaving an Admin team through organization leave return 403. Server-only addMember is not exposed over HTTP (404).

  • ✅ PASS Admin-team invitation and raw route bypasses are denied — A direct Admin cannot refresh or cancel the privileged pending invitation; raw team/invitation writes and leaving an Admin team through organization leave return 403. Server-only addMember is not exposed over HTTP (404).

ℹ️ ASSERTION — 3. SCIM controls membership but never derives roles from group names

An IdP group named super-admin grants nothing until approved, then only Admin. PATCH/PUT removals revoke immediately. Mapping disable/re-enable, group deletion, and provider removal clear designation; retained teams and direct roles do not retain inherited authority.

  • ✅ PASS SCIM controls membership but never derives roles from group names — An IdP group named super-admin grants nothing until approved, then only Admin. PATCH/PUT removals revoke immediately. Mapping disable/re-enable, group deletion, and provider removal clear designation; retained teams and direct roles do not retain inherited authority.

ℹ️ ASSERTION — 4. Workflow automation admission resolves current team authority

The live Automation API reaches version validation for inherited Admin; clearing the team grant makes the next request forbidden. Direct Admin still reaches version validation without a team grant. No Automation is created.

  • ✅ PASS Workflow automation admission resolves current team authority — The live Automation API reaches version validation for inherited Admin; clearing the team grant makes the next request forbidden. Direct Admin still reaches version validation without a team grant. No Automation is created.

Test run created 2026-09-08T19:01:36.459Z · Source: evals/results/test-runs/2026-09-08T19-01-36-459Z-team-admin-grants-are-live-scoped-protected-and-cleared-across-scim-lifecycles/test-run.json · Repro: pnpm --dir evals artifacts:publish -- --pr 4626 --test-run 2026-09-08T19-01-36-459Z-team-admin-grants-are-live-scoped-protected-and-cleared-across-scim-lifecycles

@OmarMcAdam

Copy link
Copy Markdown
Member Author

Test evidence — an-integration-authenticates-and-manages-teams-with-the-generated-den-sdk — ✅ passed

SHA 5157a5c · engine v1

✅ passed · 7 expectations passed · 0 failed · 0 pending

screenshots not attached (gh < 2.99; run brew upgrade gh)

verdict passed · 0 user observations · 0 probes · steps 0/0

ℹ️ ASSERTION — 1. Public health and protected identity

Health succeeds without credentials; identity returns 401 with no data.

  • ✅ PASS Public health and protected identity — Health succeeds without credentials; identity returns 401 with no data.

ℹ️ ASSERTION — 2. Default URL and custom transport

The default HTTPS health URL is passed to the custom fetch, which reaches the isolated Den successfully.

  • ✅ PASS Default URL and custom transport — The default HTTPS health URL is passed to the custom fetch, which reaches the isolated Den successfully.

ℹ️ ASSERTION — 3. Session organization context and request overrides

With a different default organization, the configured orgId places a team in the selected organization. An unscoped client creates a distinct team in the default organization; a per-request override selects that organization without changing the client default.

  • ✅ PASS Session organization context and request overrides — With a different default organization, the configured orgId places a team in the selected organization. An unscoped client creates a distinct team in the default organization; a per-request override selects that organization without changing the client default.

ℹ️ ASSERTION — 4. Session and API-key authentication

Both credentials resolve to the issuing user; an invalid key rejects.

  • ✅ PASS Session and API-key authentication — Both credentials resolve to the issuing user; an invalid key rejects.

ℹ️ ASSERTION — 5. Typed query parameters

The numeric limit becomes ?limit=1 and Den accepts the request.

  • ✅ PASS Typed query parameters — The numeric limit becomes ?limit=1 and Den accepts the request.

ℹ️ ASSERTION — 6. Typed body, path, and request overrides

A team is created in the selected org and renamed by ID; an invalid per-request key rejects the mutation.

  • ✅ PASS Typed body, path, and request overrides — A team is created in the selected org and renamed by ID; an invalid per-request key rejects the mutation.

ℹ️ ASSERTION — 7. Deletion and error responses

The deleted team cannot be updated: HTTP 404 and no success data.

  • ✅ PASS Deletion and error responses — The deleted team cannot be updated: HTTP 404 and no success data.

Test run created 2026-09-08T19:01:12.414Z · Source: evals/results/test-runs/2026-09-08T19-01-12-414Z-an-integration-authenticates-and-manages-teams-with-the-generated-den-sdk/test-run.json · Repro: pnpm --dir evals artifacts:publish -- --pr 4626 --test-run 2026-09-08T19-01-12-414Z-an-integration-authenticates-and-manages-teams-with-the-generated-den-sdk

@OmarMcAdam

Copy link
Copy Markdown
Member Author

Test evidence — dpa-policy-blocks-warm-managed-keys-without-revoking-customer-owned-models-or-an — ✅ passed

SHA 5157a5c · engine v1

✅ passed · 18 expectations passed · 0 failed · 0 pending

screenshots not attached (gh < 2.99; run brew upgrade gh)

[world] den(local) · [seed] api GET /v1/org · [seed] api PATCH /v1/inference
[probe] eventually(inference admitted and blocked on limits SQL) · eventually(real Stripe checkout retrieval held)
verdict passed · 0 user observations · 2 probes · steps 0/0

ℹ️ ASSERTION — 1. Absent DPA flag permits real managed inference

A pre-issued DB-backed key returned HTTP 200 and the independent upstream saw exactly one authenticated managed request.

  • ✅ PASS Absent DPA flag permits real managed inference — A pre-issued DB-backed key returned HTTP 200 and the independent upstream saw exactly one authenticated managed request.

ℹ️ ASSERTION — 2. Only allowlisted platform administrators may record DPA decisions

Workspace admin and foreign admin received 403, anonymous caller 401, invalid payloads 400; independent storage still had no flag or audit events.

  • ✅ PASS Only allowlisted platform administrators may record DPA decisions — Workspace admin and foreign admin received 403, anonymous caller 401, invalid payloads 400; independent storage still had no flag or audit events.

ℹ️ ASSERTION — 3. Warm-key denial is organization-bound and cannot be spoofed or retried around

Same process, key, bearer and session: completion and models are 403, body/header scope spoofing, fallback payloads and retries add zero upstream calls. Same user in a second organization still completes with its own key; foreign membership does not confer access.

  • ✅ PASS Warm-key denial is organization-bound and cannot be spoofed or retried around — Same process, key, bearer and session: completion and models are 403, body/header scope spoofing, fallback payloads and retries add zero upstream calls. Same user in a second organization still completes with its own key; foreign membership does not confer access.

ℹ️ ASSERTION — 4. Managed denial follows source, not display name

Name-only public PATCH is rejected with 400. A datastore-arranged rename preserves source=openwork; lists still hide it, direct connect stays redacted, and the warm inference key returns 403 with no upstream call. This does not claim public rename support.

  • ✅ PASS Managed denial follows source, not display name — Name-only public PATCH is rejected with 400. A datastore-arranged rename preserves source=openwork; lists still hide it, direct connect stays redacted, and the warm inference key returns 403 with no upstream call. This does not claim public rename support.

ℹ️ ASSERTION — 5. Managed inventory and purchase admission are disabled without breaking connect sync

Usable/manageable lists and resource snapshot hide managed providers. Direct connect stays 200 with null credentials and no models. Enable and both checkout forms return policy 403 without new keys or external HTTP attempts.

  • ✅ PASS Managed inventory and purchase admission are disabled without breaking connect sync — Usable/manageable lists and resource snapshot hide managed providers. Direct connect stays 200 with null credentials and no models. Enable and both checkout forms return policy 403 without new keys or external HTTP attempts.

ℹ️ ASSERTION — 6. GET repair cannot restore missing managed member access

After arranging a missing member provider and revoked member key, both members' inference/list GETs returned 200 without changing stored keys/providers; the owner's pre-issued key remains 403.

  • ✅ PASS GET repair cannot restore missing managed member access — After arranging a missing member provider and revoked member key, both members' inference/list GETs returned 200 without changing stored keys/providers; the owner's pre-issued key remains 403.

ℹ️ ASSERTION — 7. New member acceptance does not provision managed access under DPA

An existing foreign account accepted a real invitation as an ordinary member; its scoped list is empty and independent storage contains no managed key or provider for that new membership.

  • ✅ PASS New member acceptance does not provision managed access under DPA — An existing foreign account accepted a real invitation as an ordinary member; its scoped list is empty and independent storage contains no managed key or provider for that new membership.

ℹ️ ASSERTION — 8. Customer-owned providers survive branding overlap and route with delivered credentials

Owner and member list/connect the custom OpenRouter/OpenWork-branded provider, then use its delivered endpoint, model and credential for real HTTP completions witnessed as authenticated BYOK. Managed key stays blocked. This is a delivered-config client, not an OpenCode runtime claim.

  • ✅ PASS Customer-owned providers survive branding overlap and route with delivered credentials — Owner and member list/connect the custom OpenRouter/OpenWork-branded provider, then use its delivered endpoint, model and credential for real HTTP completions witnessed as authenticated BYOK. Managed key stays blocked. This is a delivered-config client, not an OpenCode runtime claim.

ℹ️ ASSERTION — 9. Ordinary and raw BetterAuth metadata writes cannot set or erase the flag

Strict Den writes rejected extra metadata/flag with 400; raw BetterAuth replacement and creation attempts returned 403. Flag remains true with exactly one approved audit event.

  • ✅ PASS Ordinary and raw BetterAuth metadata writes cannot set or erase the flag — Strict Den writes rejected extra metadata/flag with 400; raw BetterAuth replacement and creation attempts returned 403. Flag remains true with exactly one approved audit event.

ℹ️ ASSERTION — 10. Approved unset restores the original key and records the transition

The warm key returned 200 with explicit false; datastore audit identifies the approving actor, previous true, new false and reason.

  • ✅ PASS Approved unset restores the original key and records the transition — The warm key returned 200 with explicit false; datastore audit identifies the approving actor, previous true, new false and reason.

ℹ️ ASSERTION — 11. Generated SDK carries the DPA body and preserves admin authorization

Generated typed set/unset calls send the flag and reason and return the declared success body, verified against persisted metadata and audit transitions. A workspace admin using the same generated method receives 403 with no mutation or new audit.

  • ✅ PASS Generated SDK carries the DPA body and preserves admin authorization — Generated typed set/unset calls send the flag and reason and return the declared success body, verified against persisted metadata and audit transitions. A workspace admin using the same generated method receives 403 with no mutation or new audit.

ℹ️ ASSERTION — 12. Audit insertion and DPA mutation are atomic

A real audit column outage caused admin PATCH 500; after storage recovery no event was added and the flag stayed false with the original key usable.

  • ✅ PASS Audit insertion and DPA mutation are atomic — A real audit column outage caused admin PATCH 500; after storage recovery no event was added and the flag stayed false with the original key usable.

ℹ️ ASSERTION — 13. Concurrent ordinary/admin metadata changes preserve DPA and unrelated nested data

Three concurrent rounds of branding, capability and DPA updates all returned 200, preserved nested fixture metadata and all requested changes, added one audit each, and kept inference blocked.

  • ✅ PASS Concurrent ordinary/admin metadata changes preserve DPA and unrelated nested data — Three concurrent rounds of branding, capability and DPA updates all returned 200, preserved nested fixture metadata and all requested changes, added one audit each, and kept inference blocked.

ℹ️ ASSERTION — 14. Policy parsing and unavailable storage fail closed

Serialized object true returns 403; malformed JSON, array, scalar, non-boolean flags and real missing metadata column return 503 with zero upstream calls. Restoring absent flag permits the original key.

  • ✅ PASS Policy parsing and unavailable storage fail closed — Serialized object true returns 403; malformed JSON, array, scalar, non-boolean flags and real missing metadata column return 503 with zero upstream calls. Restoring absent flag permits the original key.

ℹ️ ASSERTION — 15. Policy is re-read immediately before dispatch

Independent SQL processlist proved a request had passed initial admission and was blocked on limits. An approved policy change committed before releasing that lock. Same in-flight request returned 403 with zero upstream calls; unset restored 200.

  • ✅ PASS Policy is re-read immediately before dispatch — Independent SQL processlist proved a request had passed initial admission and was blocked on limits. An approved policy change committed before releasing that lock. Same in-flight request returned 403 with zero upstream calls; unset restored 200.

ℹ️ ASSERTION — 16. Delayed checkout sync records purchase history without reactivation

A real SDK checkout retrieval was held over the approved DPA transition. Release returned sync 200 and persisted active purchase quantity 7 plus checkout event ID. Revoked keys, absent managed providers and disabled inference metadata stayed unchanged; zero inference calls.

  • ✅ PASS Delayed checkout sync records purchase history without reactivation — A real SDK checkout retrieval was held over the approved DPA transition. Release returned sync 200 and persisted active purchase quantity 7 plus checkout event ID. Revoked keys, absent managed providers and disabled inference metadata stayed unchanged; zero inference calls.

ℹ️ ASSERTION — 17. Signed delayed Stripe webhooks retain history without managed reactivation

Invalid HMAC was rejected with 400 before any SDK read or history change. Real signature verification accepted completed and async-payment-success events, including repeated deliveries, with event IDs persisted. Keys/providers and disabled inference remained unchanged; no inference upstream calls.

  • ✅ PASS Signed delayed Stripe webhooks retain history without managed reactivation — Invalid HMAC was rejected with 400 before any SDK read or history change. Real signature verification accepted completed and async-payment-success events, including repeated deliveries, with event IDs persisted. Keys/providers and disabled inference remained unchanged; no inference upstream calls.

ℹ️ ASSERTION — 18. Synthetic providers only

Den/inference child environments blank real provider, Stripe and telemetry credentials. Stripe uses only a fixture key and loopback SDK transport. Preload refuses non-loopback HTTP; zero external attempts were recorded and every provider request carried the expected synthetic credential.

  • ✅ PASS Synthetic providers only — Den/inference child environments blank real provider, Stripe and telemetry credentials. Stripe uses only a fixture key and loopback SDK transport. Preload refuses non-loopback HTTP; zero external attempts were recorded and every provider request carried the expected synthetic credential.

Test run created 2026-09-08T19:00:43.387Z · Source: evals/results/test-runs/2026-09-08T19-00-43-386Z-dpa-policy-blocks-warm-managed-keys-without-revoking-customer-owned-models-or-an/test-run.json · Repro: pnpm --dir evals artifacts:publish -- --pr 4626 --test-run 2026-09-08T19-00-43-386Z-dpa-policy-blocks-warm-managed-keys-without-revoking-customer-owned-models-or-an

@OmarMcAdam

Copy link
Copy Markdown
Member Author

SDK follow-up pushed in 5157a5c. Reproduced the generated-sdk stale-output failure, regenerated the SDK, and corrected the DPA route contract so its generated method carries dpaSigned/reason and typed success/error responses. Regeneration also includes team-admin fields already present in the route schemas.

Passed on this head: pnpm sdk:check (fresh generation comparison + SDK typecheck), pnpm sdk:build, Den typecheck, and the DPA / generated-SDK / organization-admin boundary journeys (1 passed each, no failures or skips). DPA proof now includes 18 assertion groups, including generated SDK set/unset and denied non-platform-admin mutation. All three PR-head evidence sections are published below/above. An isolated local schema-export database was used and removed afterward; no production actions were performed.

@diff-warden diff-warden Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (5157a5c3406994e458245b0a891a9d038ad7c0ce). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run

@OmarMcAdam
OmarMcAdam merged commit fd2868d into dev Sep 8, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant