Set up Mehen
Human prompt: Set me up with Mehen by following https://mehen.dev/setup.md
Mehen lets agents use credentials without seeing their values. A workspace owner approves new machines; a human approves sensitive requests with a passkey on the vault page.
Never ask for or accept a secret, never open an approval link yourself, and use --json for every Mehen command. Unless your harness already sets MEHEN_SESSION, prefix each setup command with MEHEN_SESSION=setup-agent (or another short label for this conversation); an export may not survive between harness calls.
The human needs an invite to a Mehen workspace first. Ask a workspace owner or administrator for an invite, accept it and register a passkey on the vault page. If there is no invite yet, stop here. Do not ask for their password, passkey or credentials.
-
Install on macOS or Linux (WSL counts as Linux). Run:
curl -fsSL https://mehen.dev/install | shSuccess ends with
mehen-install: {"version":"...","path":".../mehen"}. Ifmehenis not on PATH, apply the exact PATH line printed by the installer in this shell, or use the absolute path in that JSON. On native Windows or an unsupported architecture, stop and explain that macOS, Linux or WSL on arm64 or x64 is required. A checksum failure is a refusal: do not bypass it. Report it and retry only after the release or download is fixed. -
Register the machine's agents and skill. Run:
MEHEN_SESSION=setup-agent mehen setup --jsonSuccess has
agents, each withmcp,skill,filesandrestart, andnextequal tomehen enrol --json(ormehen status --jsonif already enrolled).added,updatedandunchangedare success. Reportskippedentries: a foreign or symlinked skill is left alone, and a malformed config is never overwritten. Do not use--forcewithout the human's agreement. If no agent was detected, repeat with--agent <name>frommehen setup --helpfor the agent in use. Setup edits user settings only, not the project. An agent whose Mehen entry the human added by hand (for example withclaude mcp add) comes backskippedas "not written by setup": that entry is fine to leave as it is.This release has no workspace choice: do not pass or invent a
--workspaceflag. -
Request enrolment, without opening its link. Run:
MEHEN_SESSION=setup-agent mehen enrol --json > "$HOME/.mehen-enrol.json" 2>&1 &This command streams a
status: "pending"object containingenrolment,fingerprint,askandexpiresAt, then waits. Run it in the background with its output captured (your harness's background option or the command above), then read the firstpendingline from that output. Interrupting it is safe and keeps the key;mehen wait <id>resumes. Follow theenrolmentid, not the PID. If setup already returnednext: "mehen status --json", or enrol returnserror: "already_enrolled", continue to step 5.A workspace owner approves new machines. If the human is not an owner, they send the link and the full check to an owner, who opens it and compares the check.
Relay
ask.titleandask.what,ask.urlasOpen:, the fullask.check.labelandask.check.value, andask.expiresAt. For example: "Approve this machine. Open:. The page must show fingerprint . If it differs, do not approve. Valid until <ask.expiresAt> (15 minutes). I will wait." Never shorten the check, hide the URL, describe the request as safe or drive the page yourself. If your harness draws vault cards from Mehen output, do not also send the link. Follow https://mehen.dev/skill.md for the complete ask rules. -
Wait in short calls. If enrolment is no longer running, use the exact
enrolmentid from step 3:MEHEN_SESSION=setup-agent mehen wait <id> --timeout 30 --jsonSuccess has
kind: "enrol"andstatus: "active"(orstatus: "active"directly from the original enrol command), withtenantanddevice; this completes enrolment. Atimeoutordevice_pendingmeans the human has not finished: keep the ask visible and repeat a short wait. Do not start another enrolment just because the human needs time. Links expire after 15 minutes. If expired, runMEHEN_SESSION=setup-agent mehen enrol --jsonagain to get a fresh link for the same key and relay the new ask, including its full check. A refusal or identity mismatch is a stop, not a reason to bypass the check. Aforbiddenrefusal on the page means the human is not an owner: ask an owner to approve. -
Reload the agent, then confirm. Tell the human to follow each agent's
restartinstruction from setup so the new MCP tools load. Run:MEHEN_SESSION=setup-agent mehen status --jsonSuccess exits 0 with
vault,tenant,device,nameandscope: the vault accepts this machine. If thevault_*tools are missing after the reload, runMEHEN_SESSION=setup-agent mehen setup --jsonagain; it should reportaddedfor that agent, then reload again. After reload callvault_statustoo; it must showenrolled: true. If the CLI returnserror: "unauthenticated"(exit 6), return to step 3. For other failures runMEHEN_SESSION=setup-agent mehen doctor --json, relay itsnextinstruction and stop on a refusal. Never try another identity, host or credential to evade one.
What you can do now
Label these commands as the skill says: keep a MEHEN_SESSION your harness sets, or prefix your own short label for this conversation.
- Run a project's command using the environment in
mehen.toml:mehen run --env dev -- npm test. This runs a process rather than returning JSON; never print its environment. - Call an API without reading its key:
mehen fetch github GET https://api.github.com/user --json(replacegithubwith an item the human has granted). - Request a credential:
mehen request api-key --name openai-dev --provider openai --reason "Use the development API" --json. Relay the ask to the human; they enter the credential only on the vault page.