Analytics agents can't get fixed roles: per-query, expiring permissions instead
Then_Respect_1964 · reddit · 2026-10-17
The author shares lessons from building access control for agents that query production data, mostly analytics and debugging agents. These agents can't be given a normal role: an analytics agent writes a different query per question, a debugging agent goes wherever the problem is — so you either over-grant access or block the work.
His approach: grant each request its own permission covering just that one query, approved by a human or policy, and expiring. Repeated queries reuse the approval; anything new needs fresh approval.
Two design lessons he calls out:
- Permissions must be re-checked at use time, not just at approval — roles and environments change.
- Query identity depended on the agent's free-text "purpose", so rewording the purpose forces re-approval — a gap he only found while documenting.
He published the full engineering record with these gaps and asks how others handle it: scoped roles, read replicas, or human approval flows?
Related event: Devs add per-query authorization layer for database MCP agents(2 posts)→
More from coding & agent
- Claude Code 2.1.302: prompt tokens jump 39% in a day, system share rises — ClaudeCodeLog · 2026-10-17
- Agent ports a Rails app to Jai with one prompt: 'things move fast' — lucasmeijer · 2026-10-17
- From 'git push heroku master' to telling Codex: keep my app deployed and healthy — alex_frantic · 2026-10-17
- AI finally configures a Home Assistant setup the author dodged for 3 months — haydendevs · 2026-10-17
- Delegating to dumber models to save tokens is a bad trade, argues heavy AI user — brandon_galang · 2026-10-17
- Dev builds Subway Surfers-style flying Tesla Roadster game with Gemini 4 Argon — ammaar · 2026-10-17