You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(auth): agent-scoped keys can toggle their own agent's autonomy — PUT /api/agents/{name}/autonomy lacks reject_agent_principal #2996
PUT /api/agents/{name}/autonomy has no agent-principal rejection, so an agent-scoped MCP key can probably toggle its own agent's autonomy (and therefore whether its schedules fire).
Cause
routers/agent_config.pyset_agent_autonomy_status → services/agent_service/autonomy.pyset_autonomy_status_logic (~L88-90 on dev) gates only on:
Per Invariant #8, get_current_user resolves an agent-scoped MCP key to its owner carrying the owner's identity, so can_user_share_agent passes for the agent's own key. There is no reject_agent_principal call and no admin gate.
Toggling autonomy is a grant (it decides whether the agent may run unattended), not a use, so under the grant-vs-use rule it should be human-only.
Why it matters now
The autonomy dial in #2984 relies on this per-agent switch as its "hard off". If the agent can flip it, the hard off isn't one.
Verification status
Confirmed by reading the code only; no live request has been sent with an agent key yet. The first step of the fix is a failing test that calls the endpoint with an agent-scoped principal.
Fix
Add reject_agent_principal(current_user) (or route through a helper that includes it) before the ownership check. Check the GET/other autonomy write paths for the same gap.
Acceptance
An agent-scoped key gets 403 on PUT /api/agents/{name}/autonomy for its own agent; owner and admin JWTs still work. The test fails with the guard removed.
Activity
AndriiPasternak31 commentedon Sep 28, 2026
/claim. Plan reviewed; building now, together with trinity-enterprise#711 as one PR on a shared human-only check.
github-actions commentedon Sep 28, 2026
@AndriiPasternak31 This issue is already assigned to AndriiPasternak31. Use
/unclaimfirst if you want to take over.test(auth): classify the skill-set and raise_my_ask routes in the cen…
fix(schedules): say who can raise the agent timeout cap (#2996)
fix(auth): agent-config and self-service identity routes are human-on…
22 remaining items
feat(eval): Tier-0 deterministic checks + delegation link (ent#935) (#…
feat(eval): evaluation read API — aggregate/failed/trend/chain reads,…
feat(auth): ops_write — a bounded machine credential for four operati…
feat(eval): Tier-0 deterministic checks + delegation link (ent#935) (#…
feat(eval): evaluation read API — aggregate/failed/trend/chain reads,…
feat(eval): Tier-0 deterministic checks + delegation link (ent#935) (#…
feat(eval): evaluation read API — aggregate/failed/trend/chain reads,…
feat(eval): Tier-0 deterministic checks + delegation link (ent#935) (#…
feat(eval): evaluation read API — aggregate/failed/trend/chain reads,…
feat(eval): Tier-0 deterministic checks + delegation link (ent#935) (#…
feat(eval): evaluation read API — aggregate/failed/trend/chain reads,…
feat(eval): Tier-0 deterministic checks + delegation link (ent#935) (#…
feat(eval): evaluation read API — aggregate/failed/trend/chain reads,…
fix(assistant): the brain's state is read by a person only, and the o…
feat(assistant): the assistant introduces Cornelius as the company br…