DEDUPED Hot AI repos, turned into use cases Get the Monday 5

How to pass secrets to agents through env, not prompts with Harnessrouter

Give an agent a token through the harness env map so it never appears in the prompt text.

Credentials. Redaction protects the stored record, but an agent that can read a secret can still send it elsewhere if a prompt or page tells it to.

Who it is forA developer whose agent needs a deploy or API token and who wants to keep it out of prompts and logs.

The problemPasting a long token into a prompt risks the model retyping it wrong and leaking it in stored records.

The outcomeThe agent reads the value from an environment variable, and the stored record and trace redact it.

What you need first

  • Docker installed
  • About 4 GB of free disk space
  • A provider API key for at least one supported model provider
  • Python 3 if you use the Idempotency-Key example

Steps

  1. Store the secret in your workspace through PUT /v1/mcp-secrets/{ref}
  2. Set the harness env map so a variable points to vault:<name>
  3. Write the task so it refers to the variable, for example 'the token is in $DEPLOY_TOKEN'
  4. Run the task and check the response, stream and trace for the value
  5. Give the token a short lifetime and least privilege for the user and task

Prompt for your agent

Using the HarnessRouter repo at https://github.com/HarnessRouter/harnessrouter, store a secret <secret-name> with PUT /v1/mcp-secrets/{ref} and run a task that reads it from an env variable. Expected output: the task completes and the secret value does not appear in the response or trace. Verify the value is absent from the stored record before reporting success.

Caveat. The README says the redaction protects the record, not the agent, so the token must still be scoped tightly.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for HarnessRouter/harnessrouter and "Pass secrets to agents through env, not prompts"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer