{
 "schema_version": 1,
 "generated": "2026-10-24",
 "id": "harnessrouter-harnessrouter--pass-secrets-to-agents-through-env",
 "repo": "HarnessRouter/harnessrouter",
 "repo_url": "https://github.com/HarnessRouter/harnessrouter",
 "repo_slug": "harnessrouter-harnessrouter",
 "title": "Pass secrets to agents through env, not prompts",
 "page_title": "How to pass secrets to agents through env, not prompts with Harnessrouter",
 "summary": "Give an agent a token through the harness env map so it never appears in the prompt text.",
 "who": "A developer whose agent needs a deploy or API token and who wants to keep it out of prompts and logs.",
 "problem": "Pasting a long token into a prompt risks the model retyping it wrong and leaking it in stored records.",
 "outcome": "The agent reads the value from an environment variable, and the stored record and trace redact it.",
 "steps": [
  "Store the secret in your workspace through PUT /v1/mcp-secrets/{ref}",
  "Set the harness env map so a variable points to vault:<name>",
  "Write the task so it refers to the variable, for example 'the token is in $DEPLOY_TOKEN'",
  "Run the task and check the response, stream and trace for the value",
  "Give the token a short lifetime and least privilege for the user and task"
 ],
 "agent_prompt": "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.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "60 minutes",
 "basis": "readme",
 "caveat": "The README says the redaction protects the record, not the agent, so the token must still be scoped tightly.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "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"
 ],
 "risk": "sensitive",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "credentials",
   "notice": "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."
  }
 ],
 "best": false,
 "score": 0.6,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/harnessrouter-harnessrouter/pass-secrets-to-agents-through-env/",
 "md": "https://dedupedai.com/use-cases/harnessrouter-harnessrouter/pass-secrets-to-agents-through-env/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/harnessrouter-harnessrouter--pass-secrets-to-agents-through-env.json",
 "api_version": "v1"
}
