Authenticate AI agents to an SSH gateway as themselves, and attribution becomes one field

Top_Kaleidoscope2824 · reddit · 2026-11-16

A practical pattern for attributing server actions to AI agents: have the agent authenticate to a gateway as itself and never hold the server credential, so "was it the agent?" reduces to reading one log field.

The gateway picks the server account, issues single-use tokens, and logs every command with two names: the agent's gateway login and the shared server account. The author tested this with a script standing in for the agent (no model involved) on JumpServer: whoami returned only labuser, but each command's audit record carried the script's gateway login (laballowed) alongside it.

Limitations noted: the pattern stops at SSH gateways and doesn't cover API tokens, OAuth grants, or SaaS tool calls; it tells you who acted, not whether an allowed action was intended. The post ends by asking how others separate agent identity from their own credentials for MCP tools that hit authenticated APIs.

Original post →

More from coding & agent

coding & agent channel →