tsudo is a temporary sudo proxy for AI agents. A human enters the real sudo password locally, then gives the agent a short-lived temporary token. The agent can run privileged commands only through tsudo, and every proxied command is printed and logged.
npm install -g @duyld/tsudoInstall the Claude Code skill from GitHub:
npx skills add duylddev/tsudoCreate a temporary token with the default 10 minute lifetime:
tsudoCreate a token for a specific duration:
tsudo 30m
tsudo 1hRun a privileged command through the proxy:
tsudo run --token <temporary-token> -- apt updateShow recent logs:
tsudo logs 10Check logs for suspicious commands:
tsudo checkShow active session status:
tsudo statusClear the active session:
tsudo clear- The agent loads the
tsudoskill. - The agent checks whether
tsudois installed. - If needed, the agent asks before running
npm install -g @duyld/tsudo. - The human runs
tsudoortsudo <duration>and enters the real sudo password locally. - The human gives the temporary token to the agent.
- The agent shows every privileged command before it runs.
- The agent runs privileged commands only with
tsudo run --token <temporary-token> -- ....
tsudo is designed to avoid sending the real sudo password to an AI agent. The real password remains on the local machine and is used only by the tsudo process to feed sudo -S.
Important limitations:
- The current session file is protected with user-only file permissions, but the password is still present locally for the token lifetime.
- Any process with access to the same user account may be able to read files owned by that user.
- The temporary token should be treated as sensitive until it expires.
tsudo checkuses conservative pattern matching. It can miss dangerous commands and can flag harmless commands.- This tool does not replace careful human review of privileged operations.
Logs are stored as JSONL under ~/.tsudo/logs.jsonl. Logs include command arguments, working directory, exit status, and danger classification. They do not include the real sudo password, temporary token, command stdin, or environment variables.
npm install
npm run typecheck
npm test
npm run build
npm pack --dry-runBefore publishing, run:
npm run prepublishOnly
npm publish --access publicDo not publish until the package metadata and repository URL are final.