DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to keep API keys away from an agent with credential injection with Box

Let the egress gateway add API credentials to permitted requests so the agent never sees them.

Short answer: Read the security model in docs/user/security.md; then read the policy guide in docs/user/policy.md to write permit rules for the API hosts and paths you allow; add the API credentials and the allowed request rules to your Box.toml and policy.dw as the guides describe. All steps.

Credentials. Store real API keys only in the locations the Box security docs describe and test with throwaway keys first.

Who it is forA team lead who wants an AI agent to call paid or private APIs without handing the agent the raw secret.

The problemPutting API keys in an agent's environment or prompt lets the agent leak them, log them, or reuse them outside the task.

The outcomePermitted requests are authenticated by the gateway with configured API credentials or AWS SigV4 signing, and the agent does not receive the underlying secrets.

What you need first

  • A Mac with Apple silicon running macOS 15 or later
  • Node.js 22.21 or later from Homebrew, if you follow the getting-started guide
  • Access to Claude Opus 5 on Amazon Bedrock in us-west-2, if you follow the getting-started guide
  • A Rust toolchain via rustup, only if you build from source

Steps

  1. Read the security model in docs/user/security.md.
  2. Read the policy guide in docs/user/policy.md to write permit rules for the API hosts and paths you allow.
  3. Add the API credentials and the allowed request rules to your Box.toml and policy.dw as the guides describe.
  4. Run the Box and send a permitted request from the agent to the allowed host.
  5. Check the decision records to confirm the request was permitted and that the agent's own environment holds no key.

Prompt for your agent

In the strands-agents/box repository, read docs/user/security.md and docs/user/policy.md, then configure credential injection for <api-host> in box.toml and policy.dw. Expected output: a permitted request to <api-host> succeeds and the agent's environment does not contain the API key. Verify that a request to a host not in a permit rule is denied.

Caveat. The README says the gateway injects configured credentials but does not give the exact config keys, so confirm them in the guides before relying on this.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for strands-agents/box and "Keep API keys away from an agent with credential injection"

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