autologin-mcp

Security model

autologin-mcp has one job: an AI agent can log in to the app it is testing, but the password never enters the model’s context. Everything below serves that goal.

What the agent can and cannot see

The agent sees The agent never sees
Profile names, root URLs and usernames (list_profiles) Passwords
The login outcome (success, failed with the page’s error message, …) The content of the credentials file
The one-time loader script (a 127.0.0.1 URL, no credential) The credentials response of the bridge
After login: the app itself, including session cookies, as with any logged-in browser  

Protections

Risk What autologin-mcp does
The agent reads the credentials file with Read, cat, grep or a sub-agent install adds a Claude Code PreToolUse hook that blocks every tool call touching ~/.autologin-mcp: file tools by path, shell commands and other tools by text. Hooks also run in “skip permissions” mode. Read/Edit deny rules are a second layer.
A password in a tool result or an error message Every result passes through a redactor that removes each configured password and its URL-encoded form. The in-page filler scrubs the password from any error text it returns.
A password in the environment Values are parsed in memory and never copied into process.env.
A malicious or prompt-injected page asks the agent to “log in here” A profile only fills pages whose host matches its root URL. In CDP mode the host comes from Chrome itself; in bridge mode from the Origin header, which the browser sets and page scripts cannot change.
Another program or page uses the bridge The bridge listens on 127.0.0.1 only, on a random port. Each script carries a random 192-bit token, works once and expires after 60 seconds. A profile can be released at most 20 times in five minutes.
The agent re-runs a used script It receives the first run’s outcome, not the credentials.
A wrong password locks the account After three failed logins in five minutes, the profile is paused (rate_limited).
The password stays in the page after a failed attempt The password field is cleared.
A silent update of a tool that handles credentials install pins the exact package version.

Limits

autologin-mcp prevents accidental exposure. It is not a sandbox against a deliberately hostile agent.

Recommendations

Reporting a vulnerability

Please do not open a public issue. Use GitHub’s private reporting: Security → Report a vulnerability. See SECURITY.md for the scope.

Edit this page on GitHub