mehendocs

GuidesPut a credential into another service

Put a credential into another service#

How does an agent get a secret into GitHub Actions, Vercel or a Cloudflare Worker without seeing the value?

On this page

A deploy often needs a secret in another service's own store: an Actions secret for a workflow, a Vercel variable for a build, a Worker secret. mehen push asks a human to let the vault put one secret field there. Once the human approves, the vault reads the value and calls the provider itself. The value never reaches the agent's machine, and the agent gets back only where it went. It needs mehen 0.3.18 or later.

Use it instead of leasing the value with mehen run or typing it into the provider's dashboard with mehen fill.

Push is switched on workspace by workspace. Where it is off, mehen push is refused with forbidden, "Pushing is not available yet.", and a credential page shows no Other services' secret stores card. A managed workspace has no pushing: it is refused with forbidden, "Pushing is not available in a managed workspace."

What the human allows#

Two credentials take part: the one pushed, and the provider credential that writes it (a GitHub token or connection, a Vercel token or a Cloudflare API token).

  1. The credential may be pushed. On its page, under Other services' secret stores, a person who may change the credential ticks May be put into other services' secret stores and saves with a passkey. It is off until then. An OAuth client or connection is never pushed, and neither is a kind whose ceiling can never reach lease, such as an SSH key or a GitHub App.
  2. The machine may use both. The machine must be able to use the pushed credential and the provider credential through the relay, as for any request. A push counts as handing the value out, so a machine whose owner is cooling off after an account recovery is refused.
  3. The provider credential reaches the provider. Its bound hosts must cover the provider's API (api.github.com, api.vercel.com or api.cloudflare.com), and its policy must not deny the calls the push makes.

Credentials has the allowance in full.

What the agent runs#

mehen push openai-prod --to github:acme/app/OPENAI_API_KEY --reason 'the evals workflow calls OpenAI' --json
mehen push 'openai-prod#key' --to github:acme/app/env/production/OPENAI_API_KEY --with github-pat-ci --json
mehen push stripe-prod --to vercel:shop@acme/production/STRIPE_SECRET_KEY --json
mehen push resend-key --to cloudflare:0123456789abcdef0123456789abcdef/mailer/RESEND_API_KEY --json

The answer is exit 3, approval_required, with the ask. Write the block, then mehen wait <apr_id> --timeout 60 --json. The same push done by this machine in the last ten minutes answers at once with what was done, and asks no one.

Destinations#

DestinationWhere it goes
github:<owner>/<repo>/<NAME>A GitHub Actions repository secret
github:<owner>/<repo>/env/<environment>/<NAME>A GitHub Actions secret for one environment
github:<owner>/<repo>/dependabot/<NAME>A GitHub Dependabot secret
vercel:<project>[@<team>]/<production|preview|development>/<NAME>A Vercel environment variable for one target
cloudflare:<account id>/<script>/<NAME>A Cloudflare Worker secret; Cloudflare deploys the Worker again with it

The vault reads every part in one canonical form. Owners, repositories, environments, projects, teams, accounts and scripts are lower case, except a Vercel prj_ or team_ id, which keeps its case. A GitHub secret's name is upper case and may not start with GITHUB_; any other name keeps its case. A destination is ASCII only. MCP takes the same destination as JSON, already canonical (Agent reference).

What the human approves#

Every push asks a human, every time, on the ask's own page. The card says where the value goes and what the provider said about that place before anyone decided: whether the secret is already there, whether a GitHub repository is public or a fork, and New destination when this workspace has never pushed to that owner and has not bound the repository to a project. It names the store, the secret's name, the value's version, the credential that writes it, and who can read the secret there. It warns that Mehen cannot take a push back.

Approving takes a passkey, which signs the exact destination, the value's version and both credentials' settings. A push is approved once, as asked: no standing rule, task grant or posture covers one, and it is decided only on its own vault page, never in Review together. Who may approve is whoever may approve the credential's other requests; a private provider credential narrows that to its owner, and a credential a protected environment needs four eyes for needs a second person (Approvals).

After the approval#

The vault sends the push at once and mehen wait follows it to its end:

The approval is spent either way. Do not push again unless the human asks.

A push is not sent if, between the approval and the send, either credential changed, the allowance was turned off, the workspace was frozen, the machine was revoked or its access changed, another push to the same place was being sent, or two minutes passed. An ask still waiting goes stale when either credential's value or settings change: ask again.

What is recorded#

None of it holds the value.

Pushing a new value again#

After a rotation, the credential's Pushed to card offers to put the current value into the places that still hold an older one. A person who may change the credential ticks each place and signs once with a passkey for up to 25. The same provider credential writes each one again. A credential a protected environment needs four eyes for is pushed again only from a machine's ask, so a second person decides.

What push never does#