Skip to main content
Glama
Offprompt

Offprompt

Official

offprompt

npm check MIT licence

offprompt lets a coding agent ask you for a secret and have it land where the project needs it, without the value passing through the model.

Agents need API keys. Paste one into the chat and it goes into the model's context, the transcript on disk and the provider's logs, and stays there. offprompt gives the agent another way to ask: a tool call that opens a page in your browser, from which the value goes straight into the file. The transcript only ever sees the key's name.

How it works

  1. The agent asks. It calls collect_secret with every key it needs, why it needs them, and the file they go in, then waits inside the call.

  2. A page opens on 127.0.0.1 in your browser. It says which agent is asking, what for, and which file it writes to. Each field checks its value as you type, paste or import it, and links to where the key is made.

  3. The file is written. offprompt answers the agent with the key names, the file and a four-emoji fingerprint, the same four your page shows. From then on the agent reads the values from the environment by name.

When the agent runs in a cloud sandbox, it gives you a link to the page instead. The page reaches you through a Cloudflare tunnel, and your browser encrypts the values first, to a key only the sandbox holds.

The page itself can be tried at offprompt.dev/playground.

Related MCP server: vault-mcp

Install

In a project's folder:

npx offprompt init

That puts the server in the project as tools/offprompt/mcp.mjs, one file that runs on node alone, and declares it in the project config of each agent found on your machine. Commit those files together with tools/offprompt/, and everyone on the project gets offprompt, as does every cloud sandbox that clones it.

To have offprompt in every project you open instead, install it for yourself:

npx offprompt init -g
npx offprompt list        # every agent, whether it was found, and how offprompt reaches it
npx offprompt remove      # out of this project
npx offprompt remove -g   # out of every agent that has it

offprompt runs on Node 22 or later. Installation covers choosing agents with --agent, and updating.

Agents

offprompt is an MCP server, so any agent that speaks MCP can use it. init sets these up:

Agent

In a project

With -g

Claude Code

.mcp.json

A plugin

Codex

.codex/config.toml

A plugin

Cursor

.cursor/mcp.json

A copy of the plugin in ~/.cursor/plugins/local/

Pi

.pi/mcp-adapter.json, through pi-mcp-adapter

A server in Pi's agent directory

Every other agent add-mcp knows, such as Gemini CLI, VS Code, OpenCode, Goose, Kiro CLI, Windsurf and Zed

No

A server in its MCP config

Claude Code asks once before it starts a server a project declares. Codex and Pi read a project's config only in a project you trust. Agents has each one in detail.

Manual MCP config

Any other MCP client, Cline among them, can start offprompt from npm:

{
  "mcpServers": {
    "offprompt": {
      "command": "npx",
      "args": ["-y", "offprompt", "mcp"]
    }
  }
}

Cline also needs the project as cwd, since it names no project to the servers it starts. llms-install.md has the entry for Cline, and steps an agent can follow to install offprompt.

Documentation

docs.offprompt.dev has the rest: what the agent can ask for, the page, every provider offprompt knows and the checks on its keys, the tools, cloud sandboxes and troubleshooting. offprompt.dev shows offprompt at work.

Security

A value goes from your browser to offprompt to the file, and never through the model, the transcript, or a tool's arguments and results. offprompt does not guard the file once it is written, or protect against another program running as you: the threat model says what it covers, and SECURITY.md how to report a problem.

What offprompt runs and reaches:

  • A server on 127.0.0.1, which serves the page and takes the write. The page loads nothing from the network.

  • Your browser, opened with the platform's URL handler, never a shell: open on macOS, xdg-open on Linux, rundll32 url.dll,FileProtocolHandler on Windows. The agent's host is offered the page first.

  • In a cloud sandbox, cloudflared, to reach the page through a Cloudflare quick tunnel that carries only ciphertext. It uses a cloudflared already on PATH, or downloads a pinned release from Cloudflare's GitHub releases once and checks its SHA-256 before running it.

It sends nothing to us, keeps no values once they are written, and collects no telemetry.

Development

A pnpm workspace, on Node 22.13 or later. From a checkout, pnpm install, then pnpm agents --project ~/projects/some-project installs offprompt into a project the way npx offprompt init does. CONTRIBUTING.md has the tests, the layout and how to add a provider.

Licence

MIT, for everything in this repository. The parts that are other people's work keep their own terms, listed in packages/offprompt/THIRD_PARTY_NOTICES.md for the server, the packages bundled into it and the page it serves, in apps/site/THIRD_PARTY_NOTICES.md for offprompt.dev and in apps/docs/public/third-party-notices.txt for docs.offprompt.dev.

Available Tools

3 tools
await_secretWait for a secret to be writtenA
Read-only

Wait for a collect_secret request that came back still "awaiting" — which happens when offprompt runs in a cloud sandbox, had no browser to open and handed you the page URL to pass on, or runs in a host that ends a tool call before the human is done. Long-polls for up to 60 seconds, 50 in Cline, and returns "written", "awaiting" or "expired". Call it again while the status is "awaiting", with no other work in between. When you were given a link to pass on, an "awaiting" result carries it again: keep it in whatever you write to the user, or ask them, until the values are written.

Inputs: request_id (required). Returns: url, kept, note, sink, +7 more

cancel_secretCancel a secret requestA
Idempotent

Close a collect_secret request that is no longer needed. Anything already typed on the page is discarded.

Inputs: request_id (required). Returns: url, kept, note, sink, +7 more

collect_secretCollect a secret from the humanA

Get the values a task needs — API keys, tokens, connection strings, settings — written where the project reads them, typed by the human or generated by offprompt. Call this instead of asking the user to paste a secret into the conversation.

Each entry in secrets is one key, and says how its value comes to be:

  • generate: {} — a random value, 32 bytes of base64url unless set, made on the user's page (or by offprompt when no page opens); the user may paste one they already use instead. You never see it. For AUTH_SECRET, JWT_SECRET, SESSION_SECRET and encryption keys. A key that is already set is kept as it is.

  • provider — a key the human gets from a provider, such as provider: "stripe" for STRIPE_SECRET_KEY. The page shows the provider's logo and links to where the key is made.

  • format — a value of a known kind that no one provider issues, such as format: "postgres_url" for DATABASE_URL. The page links to providers where the human can create one.

  • none of these — any other value, taken as plain text. A provider's key is still recognised by its usual name. Set secret: false on a value that is not secret, such as MAX_RETRIES, and the page shows it in the clear.

Give an entry a link when you know where its value is made, so the human lands on the right page:

  • Some provider keys are made on a page that belongs to one account, organisation or project. Give that one's name or ID as parameters, such as link: { "project": "abcdefghijklmnopqrst" } for a Supabase key, and the page's "Get it" opens it. The link field lists the keys that take them and where a project keeps each value: read it from there rather than guessing. A parameter that is missing or does not fit leaves "Get it" on the key's usual page.

  • A key no provider issues, such as an internal tool's token, takes the https address where it is made. The page shows it as your suggestion, apart from offprompt's own links, and asks the human to confirm its host before it opens. A provider's key can take one too; it shows under its "Get it", never in its place. The result's links says which links were used, and why any was dropped.

When every key is generated, nothing opens: offprompt writes them and returns. Otherwise it opens a page in the user's browser and this call waits there, for up to five minutes, while the human types. It returns once the values have been written or the request has expired, so there is nothing to poll and nothing to do in the meantime. In a host that ends a tool call sooner, such as Cline, it returns "awaiting" before then: call await_secret, and again while it says awaiting, with no other work in between.

In a cloud sandbox or a remote VM, a browser opened there is one the user cannot see. Set sandbox: true only when your environment tells you that is where you run, as your instructions or the platform you run on do. A temporary folder, or a run with nobody at the terminal, is not a sign of one, and offprompt detects the common environments itself. The call then returns at once with a link: show it to the user, then wait with await_secret and do nothing else until the values are written. The user types in their own browser, and the values are encrypted there so that only the sandbox can read them.

You never receive a value. You get back the key names and the file they landed in, and you reference them by name from then on, for example process.env.RESEND_API_KEY. Never open, cat, grep or print that file afterwards: reading it puts the values into the transcript, which is the one thing this tool exists to prevent. The result lists every key the file holds, so there is nothing left to check.

A written result opens with tell_user: "Fingerprint" and four emoji the user's page shows too. Write that line to the user as soon as the call returns, before your next tool call, on a line of its own, for every write, one that comes straight after another included. The user compares the two while the page is still open, so this does not wait for the end of your task or for your next call to offprompt.

When the result carries a url, the human has to open it and nothing can happen until they do. Put the link in your reply to them, on its own line, where they will see it. A link mentioned only in your reasoning, or buried in a paragraph, is a request the human never receives. Until the values are written, put it again in whatever you write to them, your last message included: a host can fold a turn's earlier messages away and show only its last. If you have a tool that asks the user a question and waits for the answer, put the link in a question as well, since a question stays in front of them.

State the intent once: reason is shown to the human as your claim about why the values are needed, so write it for them, not for yourself.

Inputs: sink (required), reason (required), secrets (required), sandbox. Returns: url, kept, note, sink, +9 more

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 3 tools

    Disambiguation4/5

    The tools map to distinct lifecycle stages: collect initiates a secret request, await_secret long-polls an existing request, and cancel_secret closes one. There is minor overlap because collect_secret can itself block until values are written, but the descriptions clearly delimit when to use await_secret instead.

    Naming Consistency5/5

    All three tools follow the same verb_secret pattern: collect_secret, await_secret, cancel_secret. The convention is predictable and immediately readable.

    Tool Count5/5

    Three tools are well-scoped for initiating, waiting on, and cancelling a secret-collection request. Each tool earns its place in the narrow workflow, with no redundant or filler operations.

    Completeness4/5

    The core lifecycle is covered: request values, wait for completion, and cancel. Minor gaps remain, such as explicitly listing existing secrets or rotating/removing a stored value, but the primary agent workflow is complete.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables interaction with 1Password vaults and items via the op CLI, supporting vault listing, item lookup, password read/create/update/generate, and delete operations. Zero idle CPU usage and supports service account tokens for headless use.
      15 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI coding agents to securely inject API keys and secrets into environment files, configs, or commands without the agent ever seeing the secret values.
      10 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables agents to use secrets without exposing them, by injecting values into commands and redacting them from all outputs and transcripts.
      6 npm
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables agents to request an API key or other secret from the user without the value passing through chat or tool arguments/results, storing it directly to .env, the OS keychain, or 1Password. The agent receives only metadata indicating whether storage succeeded.
      1
      MIT