for agents

Pock for agents

People hand secrets to AI agents whether or not it's wise. Pock makes the agent path the easy path and the safe one: the agent never gets your master key - it provisions a scoped key to one folder, written straight into your GitHub secrets. Just as easy as pasting a .env, but scoped, revocable, and audited.

Paste this prompt into your agent (Cursor, Claude, etc.). It's also pock agent-setup in the CLI.

prompt
# Set up Pock secrets for this project

Give this project's automation (or you, the agent) access to secrets WITHOUT ever handling
the user's master key. Pock issues a SCOPED key that decrypts one folder only, so a leak
exposes nothing else.

## Preliminary checklist (show the user first)

Here's what I'll do to wire up Pock:
1. Install the pock CLI if it's missing.
2. Ask you to sign in to Pock in your browser (once).
3. Put this project's secrets under one folder and mint a SCOPED machine key for it.
4. Write that key straight into your GitHub repo's secrets; I never see it.
5. Add a workflow step that injects the secrets with `pock run`.

Shall I proceed?

## Step 1 - Install
Run: `curl -fsSL https://pock.sh/install | sh` and ensure `$HOME/.pock/bin` is on PATH.
Verify with `command -v pock && pock version`.

## Step 2 - Sign in (the user authorizes; you never see their keys)
Run `pock login`. It opens the user's browser; pause while they approve, then continue
from the CLI output. Do NOT ask for or accept the user's passphrase or Secret Key, ever.

## Step 3 - Put the job's secrets under one folder
Ask which secrets the job needs, then set them under a dotted folder (keep it minimal):
`pock vault set myapp.prod DATABASE_URL=… STRIPE_KEY=…`

## Step 4 - Mint a scoped key and provision it directly
`pock vault machine create myapp.prod --github <owner>/<repo>`
This mints a keypair that decrypts ONLY `myapp.prod`, and writes POCK_MACHINE_KEY +
POCK_TOKEN straight into the repo's GitHub Actions secrets via `gh`. The key is never
printed. If `gh` isn't available, omit `--github` (it prints the values so the user can add
them as repo secrets themselves; do NOT paste secret values into chat).

## Step 5 - Add the workflow step
In the job that needs the secrets:
    env:
      POCK_TOKEN:       ${{ secrets.POCK_TOKEN }}
      POCK_MACHINE_KEY: ${{ secrets.POCK_MACHINE_KEY }}
    steps:
      - run: curl -fsSL https://pock.sh/install | sh && echo "$HOME/.pock/bin" >> "$GITHUB_PATH"
      - run: pock run -p myapp.prod -- <the command that needs the secrets>

## Step 6 - Verify
Trigger the workflow (or a dry run) and confirm a secret is injected: assert a variable is
non-empty WITHOUT printing its value. Report success.

## Rules (do not break)
- NEVER ask for, accept, or store the user's passphrase or Secret Key. If offered, decline
  and explain a scoped machine key is safer and just as easy.
- Prefer the smallest scope. "Give me all the secrets" is a smell; scope to one folder.
- The machine key decrypts only its subtree; a leak exposes nothing else in the vault.
- List keys: `pock vault machine ls`. Revoke (re-keys the subtree): `pock vault machine rm <id>`.
- Full guides: https://pock.sh/guides

How the security works: security · guides · your keys