maisecrets menu

maisecrets / Vault references

Real values in your files, tokens for the model

An MCP server such as mcpgate masks personal data in its results with a token. Without help, a file that the AI writes from such a result holds the token. With maisecrets and a server that supports vault references, the file holds the real value, and the model still sees only the token.

Model sees ⟦EMAIL_1⟧ YOUR COMPUTER AI client for example Claude Code mcpgate resolve endpoint Services tickets, CRM tokens only call with ⟦EMAIL_1⟧ answer with ⟦EMAIL_1⟧ real value data Local file holds the address Vault hook for example maisecrets Write with ⟦EMAIL_1⟧ value K and the token, over HTTPS, same origin only
The vault hook in your AI client asks the server for the value of a token, and puts it into the local call. No line goes from the hook to the model: the model still sees only the token.

What the model sees

The model writes
To: ⟦EMAIL_1:ma•••@example.com⟧
Subject: Your order
The file on your disk
To: max@example.com
Subject: Your order

maisecrets asks the server for the value when the AI writes the token into a file or a command. It gets all values of the call or none. If the server refuses, maisecrets denies the call and names the reason.

Turn it on

  1. The server must offer vault references. In mcpgate, the operator turns on “Let local vaults read values”.
  2. Add the server yourself, at user scope, with an https URL. A server in a project’s .mcp.json starts nothing.
  3. Use the server once. With its first token, maisecrets reads the metadata of the server, makes a key and adds a header to your entry for that server. You see a notice once, with one step.
  4. Do that step: in Claude Code, type /mcp reconnect <server name> (or start Claude Code again). In Codex, start Codex again.
  5. Activate the link. A link from a login you already had waits a day. To use it at once, activate it on the server’s connections page, or sign in to the server again in the browser.

The states, and what you do

not used yet nothing to do header written /mcp reconnect waiting until … activate or sign in active values arrive first token reconnect or 1 day quarantined or revoked new key at the next start revoke, two accounts back to the header step operator switch off any state: ask the operator
/maisecrets:status shows the state of each server and the time of the last answer. At a session start, one line tells you when a state changed. The reason of a refused call uses the same words.
StateWhat you do in Claude CodeIn Codex
not used yetnothingnothing
header writtentype /mcp reconnect <server name> (or start Claude Code again)start Codex again
waiting for activation until a timeactivate it on the server’s connections page, or sign in to the server again in the browserthe same
activenothingnothing
quarantined (used by two accounts) or revokednothing: maisecrets makes a new key at the next start, and you see the header step againthe same, then start Codex again
the operator switch is offask the server’s operatorthe same

/maisecrets:settings client_header false turns vault references off and removes the header.

In Codex

A repository can bring its own .codex/config.toml and point your server entry at another URL. A fixed header would then go to that URL. So maisecrets adds a small helper to your entry, and the helper prints the header only when the folder you work in names no MCP servers of its own. In Codex this needs Python 3.11 or later, and it is off on Windows in this version.

Limits

  • Only tokens from a server that you added yourself count. A token in a file, a web page or a Bash output stays a token.
  • On Windows, a Bash command gets no server value.
  • A value written into a file is plain text there.
  • An AI agent that runs as your user can read the key, as it can read any stored value. The server’s cap, its audit and the revoke bound that.

An open design for every MCP server. Vault references are one implementation of a wider idea: a server gives the model a reference instead of a sensitive value. Sensitive References for MCP explores this as an independent pre-SEP design (repository).

The protocol, the steps on the server side and the answer codes: Local vaults. The client rules: README.