AI agents

Let your coding agent ask for keys, without ever handing them over

Claude Code, Cursor and other MCP agents connect to StackHangar. They can ask you to add a key, ask to use one, or propose a key rotation. You approve each request in your browser with a passkey. The agent gets a reference ID and your answer, never the value.

Last checked

How a request works

  1. Your agentAsks StackHangar over MCP, for example "I need the Stripe test key to run the checkout tests."
  2. StackHangarReturns a one-time approval link that works for 10 minutes. The agent shows it to you.
  3. YouOpen the link on app.stackhangar.com, check which agent is asking and why, and approve or deny with your passkey.
  4. Your agentChecks the request and gets "approved" or "denied", plus a reference ID to the item. Never the value.
The approval happens on our domain, never inside the agent's chat. Passkeys only work on the real app.stackhangar.com, so a look-alike page can't unlock your vault.

The approval page shows the agent's name, when it was connected, how many requests it has made, the project and the agent's own description of what it needs. The page tells you to approve only if you just asked your agent for this. If you didn't, deny it or let it expire.

What an agent can do

StackHangar's MCP server gives agents seven tools. None of them returns a credential value.

ToolWhat it does
list_scopeLists the projects this agent may ask about, as opaque IDs. Project names are encrypted, so the agent never sees them.
request_credential_entryAsks you to store a new key. You paste the value into StackHangar yourself, where it's encrypted in your browser. The agent gets a reference to the stored item.
request_credential_accessAsks to use a key. You pick which one, and StackHangar shows it to you, in your browser, so you can use it yourself. The agent gets a reference.
get_request_statusReturns pending, approved, denied or expired, and on approval a reference to the item.
propose_playbookProposes rotating a key, or responding to a key that may have leaked. You generate and save the new value in StackHangar.
get_playbook_statusReturns whether you approved the playbook and which steps, if any, you let the agent run.
report_step_resultTells you what the agent ran for one step, done or failed, with a short note.

An agent can't create, rename or delete projects, read item names, or list what's in your vault. It can only ask, and you answer.

Playbooks an agent can propose

An agent can propose two playbooks: rotate a key, or respond to a leaked key. It can't propose shutting a product down, because that deletes things. You approve the proposal with a passkey, and every step that touches a value runs on your device.

On Solo you can also let the agent run some steps itself: redeploy, verify that the new key works, and revoke the old key. Revoking needs your passkey again, step by step. The agent reports what it ran, and you see the report in StackHangar.

Each agent has its own identity

Guard rails on what agents send

Keys an agent has seen

If an agent created a key itself, for example by running a provider's command-line tool, or read it from a file, it saw the value. Treat that key as exposed: rotate it so only you hold the current one. The leaked-key playbook walks you through it. Mark these keys in your vault: tick "An AI agent created or saw this value" when you edit the item, or tick it once when you paste a .env an agent wrote. StackHangar then lists them under Hygiene, rotates them first in the leaked-key playbook, and clears the mark when you save a new value. StackHangar can't tell on its own what an agent saw, so you mark it. The mark is encrypted with the item.

Keys you add through an approval link aren't in this group. You type the value into StackHangar, and the agent never sees it.

Limits, stated plainly

StackHangar keeps values out of the agent's tools. It can't control what happens to a value after you take it out of the vault.

  • "Access" shows the value to you, not to the agent. When you approve an access request, StackHangar shows the value in your browser for 30 seconds so you can use it. The agent only learns that you approved.
  • Once you paste a value where the agent can read it, the agent has it. That includes a .env file in the project, a terminal the agent uses, and the agent's chat. StackHangar can't take it back.
  • An agent that can run any command can read whatever its process can. If your agent runs shell commands without asking, it can read files, environment variables and terminal output that your user account can. Use the agent's own permission settings to limit that.

Our guide to giving Claude Code and Cursor API keys safely covers how to close those gaps, with or without StackHangar.

Connect Claude Code

Run this in your terminal. It has nothing secret in it, so it's safe to run anywhere, even inside an agent chat.

claude mcp add --transport http stackhangar https://app.stackhangar.com/api/mcp

Then, in Claude Code, run /mcp, pick stackhangar and choose Authenticate. StackHangar opens in your browser: name the agent, pick its projects and approve with your passkey.

Connect Cursor and other MCP clients

Add https://app.stackhangar.com/api/mcp as a remote (HTTP) MCP server. Clients that support MCP sign-in open the same approval page in your browser.

If your client can't sign in through the browser, the Agents page can create a manual token instead. It's a long-lived secret you paste into the client's settings, so keep it out of agent chats, code and shared notes. Anyone with it can still only ask: you approve each request with your passkey.

Plans

Free includes 1 connected agent, and that agent can propose playbooks. Solo has unlimited agents and lets them run the redeploy, verify and revoke steps you allow. See pricing.