Repository navigation
fix(auth): the email whitelist takes an interactive admin, not a machine key (abilityai/trinity-enterprise#717) - #3935
Merged
Merged
Conversation
…ine key (Abilityai/trinity-enterprise#717) Adding an address to the whitelist grants an account, so the route is human-only: it takes require_interactive before body parsing. Every MCP key scope, missing scope, MFA and portal tokens and the loopback shapes are refused with 403; an interactive admin keeps the same responses. Route census baseline drops by one.
dolho
approved these changes
Oct 26, 2026
dolho
left a comment
Contributor
There was a problem hiding this comment.
Thanks for this. The change is tight and well evidenced.
Validation summary
- Lane B; all Tier 1 checks green, plus journey-smoke and prod-image-smoke.
- Re-ran the new suite with
test_2996_human_only_routes,test_3455_email_whitelist_validationandtest_837_whitelist_grant: 200 passed. - Mutation confirmed: reverting the route gate to
get_current_userturns 25 tests red, matching your figure. - Secret, host-path and enterprise-docs greps are clean; requirements, architecture and feature-flow docs are updated consistently.
- The only other whitelist writer (
/api/access/requestself-signup) is off by default and limited touser, so it is correctly out of scope.
Non-blocking notes
- The PR uses
Refsrather than a closing keyword, which is right given the pending private work. ent#717 will need a manual move tostatus-in-devafter merge. - The feature flow says the role-change route "has the same rule".
update_user_rolecallsreject_non_interactive_principaldirectly and does not performrequire_interactive's vouched-loopback refusal (the entry fence covers it). Consider wording it as "an equivalent interactive-only rule". - As the updated flow now notes, adding a whitelist entry writes no audit event, while role changes are audited. That may be worth a follow-up issue, since an entry can pre-authorise an admin sign-in.
Approving.
7 tasks done
webmixgamer
added a commit
that referenced
this pull request
Oct 26, 2026
Conflicts: - docs/memory/architecture/security.md: dev (#3935) extended the "two human-only rules" paragraph; kept dev's paragraph with this branch's class rename (agent_callable -> agent_callable_self / agent_callable_any), then the self-gate paragraph. - docs/memory/feature-flows.md: both sides added an index row; kept both, newest first. - tests/unit/_route_census.py: both sides removed baseline rows (17 here, the whitelist add in #3935); FROZEN_BASELINE_COUNT = 330, the merged baseline's exact size. Checked: #3913's routers/a2a.py change is inbound-path attribution; both outbound handlers still open with assert_own_agent and keep the switch dependency, and no new hand-copied self-gate arrived. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs abilityai/trinity-enterprise#717
Require a signed-in admin session for
POST /api/settings/email-whitelist, including entries whose first-sign-in role isuser. Previously, an admin’s user-scoped key or the system key could authorize an address that later obtained an independent interactive session.The route uses the existing INTERACTIVE dependency before reading the body and retains its admin check. Signed-in admins keep the existing success responses, duplicate wording, existing-account note and validation reasons. The shared admin gate is unchanged.
Remove the route from the frozen census baseline and pin its classification as INTERACTIVE. Add real-router tests for machine scopes, unknown/missing scope, malformed bodies and session controls. A loopback JWT carrying a vouched source agent is refused by the route gate; every loopback JWT is refused on this route by the entry fence, with a real-authentication regression test for the shape without a source agent.
Validation:
dev(fix absent).env, no submodules), seed 12345test_ent717_whitelist_session_only85,test_2996_human_only_routes67)lint_sys_modules(130 ≤ 131),lint_root_test_placement,git diff --checkThe local runs above other than the 3.13 row used Python 3.14.4; CI pins 3.13, which the 3.13 row covers. A local full unit-island diff against unmodified
dev(seed 12345, 3.14.4) showed 0 failures or errors only on this branch. Across the cross-branch Python 3.13 run the only red is a pre-existing timing flake on unmodifieddev(test_ent879_aauth_resource_route, seed 67890; 8 of 2000 isolated repeats fail), on no branch.Mutation (scratch copy; new suite +
test_2996_human_only_routes+test_3455_email_whitelist_validation+test_837_whitelist_grant, 200 tests): route gate back toget_current_user→ 25 failed / 200;assert_adminremoved → 2 failed / 200; INTERACTIVE weakened to PERSON → 10 failed / 200; baseline entry not removed → 1 failed / 200.Not run: Docker and the production-image stack check.
Matching private work remains pending. This PR does not close the tracking issue.
Journey Impact: none — existing whitelist behavior for signed-in admins is preserved; regression tests cover the tightened credential requirement.