Data as of Aug 25, 2026 · Based on 38 AI responses from ChatGPT Search and Google AI Mode · See how Parse measures this
Your brand can be here too.
If your goal is “agents can use internal tools, but the model/runtime never gets production secrets,” I’d use a credential-brokering tool gateway in front of isolated agent execution rather than giving agents direct API credentials.
Best overall architecture:
Agent → isolated runtime → policy-enforcing tool gateway → internal service
The key properties are:
This isn't just theoretical: Microsoft's current guidance emphasizes treating model-generated tool arguments as untrusted input and enforcing authorization at trust boundaries.
| Environment | Strong choice | Why |
|---|---|---|
| AWS-heavy | Amazon Bedrock AgentCore Runtime + Gateway + Identity | Particularly strong fit for secretless internal tools, IAM, VPC, microVM isolation and credential brokering |
| OpenAI-centric | OpenAI Agents SDK + sandbox + your own tool gateway/credential broker | Good agent execution layer; keep sensitive credentials outside the sandbox |
| Azure/Microsoft-heavy | Azure agent sandbox + identity sidecar/gateway | Strong secretless execution model and Microsoft identity integration |
| Multi-cloud / vendor-neutral | Isolated containers/VMs + MCP/tool gateway + Vault/workload identity | More engineering, but avoids coupling security architecture to one model vendor |
For AWS specifically, AgentCore is probably the closest off-the-shelf match to your requirement. Its Runtime gives each session a dedicated microVM, while AgentCore Gateway can sit in front of tools and enforce policies. AgentCore Identity can obtain credentials for downstream services rather than putting those credentials in agent code.
One important caveat: don't interpret “isolated runtime” as “credentials are inaccessible.” AWS explicitly notes that code running inside an AgentCore microVM can access its execution-role credentials through the metadata service, so the execution role itself must be extremely narrowly scoped.
For example, instead of:
Agent
↓
INTERNAL_API_TOKEN=prod-secret
↓
Internal API
use:
┌─────────────────────┐
│ Agent / LLM │
└──────────┬──────────┘
│ tool call
▼
┌─────────────────────┐
│ Isolated execution │
│ sandbox │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Tool Gateway / PDP │
│ │
│ • identity │
│ • RBAC/ABAC │
│ • argument policy │
│ • rate limits │
│ • audit │
└──────────┬──────────┘
│
short-lived credential
│
▼
┌─────────────────────┐
│ Internal service │
└─────────────────────┘
The gateway should own the secret, not the agent.
For particularly sensitive operations, I'd go one step further: make tools narrow business operations (create_invoice, read_customer, deploy_service) rather than generic tools like http_request, sql_query, or execute_shell.
I wouldn't make MCP itself your security boundary. MCP is useful as the tool interface, but the protocol doesn't inherently solve authorization or governance. Microsoft has explicitly highlighted the need for a control plane/policy layer around MCP tool execution.
Likewise, don't rely on a system prompt saying “never reveal credentials.” Current agent-security guidance assumes prompt injection and exfiltration attempts and recommends enforcing controls outside the model. OpenAI's current agent architecture similarly emphasizes separating the agent harness from compute specifically to keep credentials away from model-generated code.
Bottom line: if you're AWS-native, I'd start with AgentCore Runtime + AgentCore Gateway + AgentCore Identity + VPC, with narrowly scoped IAM roles. If you're cloud-neutral, build the equivalent around microVM/container isolation + a policy-enforcing tool gateway + workload identity/Vault, and keep the agent completely secretless.
To securely execute internal tools without exposing production credentials, you need an architecture that decouples agent reasoning from credential possession , while strictly isolating execution.
The industry consensus for production-grade, secure agent infrastructure relies on three core patterns working together: Credential Brokering, Just-In-Time (JIT) Micro-Sandboxing , and Policy-Enforced Gateways.
A secure execution flow moves through six mandatory checkpoints:
If you'd like to dive deeper into this setup, tell me:
I can help map out the specific implementation components for your stack.
The best infrastructure for secure AI agent tool execution is a credential-abstracted gateway using ephemeral, Just-In-Time (JIT) token injection combined with isolated execution sandboxes.
Instead of storing secrets in environment variables or passing API keys to the LLM context, architectures like dedicated Model Context Protocol (MCP) gateways or proxy microservices ensure credentials never touch the agent logic.
Core Architectural Components
| Component | Purpose | Key Mechanism |
|---|---|---|
| Credential Gateway | Intercepts tool calls and injects secrets server-side. | Keeps tokens out of LLM prompts and client memory. |
| JIT / Ephemeral Tokens | Grants minimal-scope access only for the duration of the call. | Auto-revokes tokens immediately after execution. |
| Secure Sandbox | Isolates the runtime environment from core infrastructure. | Uses microVMs or containers with memory wiped post-execution. |
| Policy Enforcement | Validates if the agent is allowed to invoke a specific tool. | Enforces least-privilege and human-in-the-loop (HITL) triggers. |
Best Practices for Implementation
If you'd like to narrow this down, tell me:
I can provide a tailored infrastructure design or code pattern.
If your requirement is “agents can invoke internal production tools, but the model/runtime never receives production credentials,” I’d use a credential-brokered tool gateway + isolated agent runtime, rather than putting secrets in the agent container.
Best general architecture:
Agent → policy/approval layer → internal MCP/tool gateway → credential broker → production service
The key property is that credentials terminate at the gateway, not at the agent.
create_ticket, query_customer, or deploy_service, rather than raw database/cloud credentials.| If you are... | I'd choose |
|---|---|
| AWS-heavy / enterprise | Amazon Bedrock AgentCore Gateway + Identity |
| OpenAI-centric and want maximum control | OpenAI Agents SDK + your own internal MCP gateway + secrets/identity broker |
| Already standardized on MCP | MCP gateway with centralized auth/policy rather than agents connecting directly to services |
| Running untrusted agent code | Add a hardened sandbox/isolated compute layer regardless of the above |
AWS AgentCore is particularly compelling for your exact requirement. Its Gateway can sit between agents and MCP/internal tools, while AgentCore Identity/Token Vault can resolve credentials at invocation time rather than exposing the underlying API key to the agent. AWS explicitly documents credential-provider references and managed credential rotation for this pattern.
For an OpenAI-based stack, the Agents SDK supports MCP servers, tool filtering, per-tool approval policies, and authorization headers. That makes it a good agent-side layer, but I'd keep the actual production credential exchange outside the agent process.
Avoid:
Agent container
├── PROD_DB_PASSWORD=...
├── AWS_ACCESS_KEY_ID=...
└── STRIPE_SECRET_KEY=...
Even if the model isn't supposed to see environment variables, an agent with shell/code execution can potentially read them and exfiltrate them. The safer pattern is:
┌── Policy / approval
│
Agent ──────────────┤
↓
Tool Gateway
│
Credential Broker
│
short-lived/scoped auth
│
↓
Internal Production API
The agent gets capabilities, not credentials.
For production, I'd go one step further: make each tool's authorization non-transitive. An agent authorized to refund_order shouldn't automatically receive a credential that also permits arbitrary database writes.
If you're choosing infrastructure today, AgentCore Gateway + Identity is my strongest off-the-shelf recommendation for AWS; otherwise, an internal MCP gateway backed by your existing workload-identity/secrets infrastructure is the architecture I'd build.
The best infrastructure for secure, credential-free tool execution is a Zero-Trust Credential Broker paired with an isolated Tool Gateway (such as a secured Model Context Protocol (MCP) server architecture). In this pattern, the AI agent never handles, sees, or stores static production credentials . Instead, the agent emits an unauthenticated or loosely scoped intent payload to an intermediary proxy layer, which enforces role-based policies, injects the proper short-lived credentials, and executes the call on the agent's behalf.
Core Architecture Components
Production Security Best Practices
If you'd like, let me know:
For this requirement, I’d use a policy-enforced tool gateway/MCP layer in front of your internal systems, with short-lived, dynamically issued credentials and isolated execution. The key is that the agent should never possess production credentials.
User
↓
Agent / orchestrator
↓
Tool gateway / MCP server
├─ authenticate agent + user
├─ authorize specific tool + arguments
├─ audit every call
├─ rate-limit / approval-gate risky actions
↓
Secrets broker (e.g. Vault)
├─ issue short-lived, scoped credential
└─ inject credential into execution environment
↓
Isolated tool runner
↓
Production API / DB
My default stack for an enterprise deployment:
Don't do:
Agent →
PROD_DATABASE_PASSWORD→ tool
Do:
Agent → authorized tool → Vault → temporary credential → isolated runner → database
The agent should see something like query_customer_orders(customer_id) and receive the result, not the underlying database password or broad API token.
HashiCorp's newer Boundary guidance goes one step further: credentials can be injected into the execution session so the agent/tool process doesn't directly handle or persist them.
| Environment | Good fit |
|---|---|
| Enterprise, multi-cloud, stringent compliance | MCP gateway + Vault + isolated runners |
| AWS-heavy | MCP gateway + AWS IAM/STS + Secrets Manager/Vault + ECS/EKS sandbox |
| Azure-heavy | MCP gateway + Entra/OBO + managed identities + Key Vault |
| GCP-heavy | MCP gateway + Workload Identity + Secret Manager + isolated Cloud Run/GKE execution |
| Cloudflare-centric | Cloudflare Agents + remote MCP + Access/OAuth; Cloudflare explicitly supports OAuth-protected MCP endpoints. developers.cloudflare.com |
| OpenAI-centric | OpenAI Agents SDK for orchestration + your own private MCP/tool gateway for sensitive internal tools |
I would not make a hosted MCP server the security boundary for sensitive production operations simply because it is convenient. The critical boundary should remain under your control, with your identity provider, authorization policy, secrets broker, network controls, and audit system. OpenAI's hosted MCP option is useful when appropriate, but private production tooling deserves a separately controlled execution plane.
SELECT but reject arbitrary SQL or restrict rows/tenants.user → agent → tool → credential → resource → result.If you're designing this for production enterprise agents, the architecture I'd bet on is MCP + policy gateway + workload identity/OBO + Vault/dynamic secrets + sandboxed runners. That separates reasoning from privileged execution, which is the security boundary you want.
For this requirement, I’d use a brokered tool-execution architecture, not give the agent direct access to production credentials.
Agent runtime → policy/tool gateway → internal tool → production resource
The key is that the agent only gets a short-lived identity or opaque tool capability. The gateway holds the real credentials and performs the privileged call on the agent’s behalf.
Isolated agent runtime
MCP/tool gateway
Workload/agent identity
Secrets broker
Policy + approval layer
Complete audit trail Log at minimum:
| Environment | Strong choice |
|---|---|
| AWS-heavy | Bedrock AgentCore + Gateway/Policy + IAM + Secrets Manager |
| GCP-heavy | Agent Runtime/ADK + Agent Gateway + Agent Identity + Secret Manager |
| OpenAI-centered, cloud-neutral | Agents SDK + isolated sandbox + your own MCP/tool gateway + workload identity/secrets manager |
| Enterprise/self-hosted | Kubernetes sandbox/runtime + MCP gateway + Vault + SPIFFE/SPIRE or cloud workload identity |
For a cloud-neutral enterprise deployment, Agents SDK + ephemeral sandbox + centralized MCP gateway + workload identity + Vault/Secrets Manager would be my default architecture.
The especially important rule is:
Never make the production credential available to the model, agent context, generated code, or sandbox filesystem.
Instead, the agent asks “call create_ticket with these parameters”; the gateway authenticates that request, checks policy, obtains the backend credential, executes it, and returns only the result. This credential-isolation pattern is also reflected in current enterprise agent architectures.
If you're choosing an actual agent infrastructure product rather than designing the architecture yourself, I can compare OpenAI Agents SDK, AWS AgentCore, Google Agent Platform, Microsoft/Azure, and self-hosted Kubernetes/MCP specifically on credential isolation, sandboxing, authorization, and production readiness.
To safely let AI agents call internal tools without exposing production credentials, you need an architecture that decouples the agent's reasoning loop from the execution and credential plane . Giving an LLM raw API keys or standing service-account tokens invites disaster via prompt injection or lateral movement.
The modern standard for production-grade, secure agent tool execution relies on a Brokered Credential / Secure Agent Runtime architecture layered over standardized communication protocols.
The Recommended Architecture: Secure Agent Runtime + MCP + Ephemeral Sandboxes
Core Security Checklist for Your Tool Infrastructure
DROP DATABASE or kubectl delete . Enforce strict JSON Schema validation and rule-based whitelisting at the gateway before execution.If you'd like, let me know:
I can tailor a more specific reference architecture or toolchain for your stack.
For production agents, I’d use a tool gateway + isolated agent runtime + short-lived identity, rather than giving the agent process credentials directly.
Agent → sandbox/runtime → policy-enforcing tool gateway → internal service
Isolate the agent
Put every sensitive tool behind a gateway
Use identity, not static secrets
Enforce authorization per tool call
agent-A → read_customer → customers:123 might be allowed.agent-A → delete_customer should be denied regardless of what the model says.| Option | Best fit |
|---|---|
| AWS Bedrock AgentCore Gateway + Runtime | AWS-heavy enterprise environments |
| Google Agent Gateway / Agent Platform | GCP-heavy environments |
| Microsoft Agent Governance Toolkit / MCP governance | Microsoft/Azure environments or teams wanting an open governance layer |
| Kubernetes Agent Sandbox + your own gateway | Maximum control / self-hosted / multi-cloud |
AWS's AgentCore is particularly close to your stated requirement: its Gateway provides governed connectivity to APIs/MCP servers with authentication, access control and policy enforcement, while the runtime handles tool invocation without exposing credentials to the agent. www.repost.aws Google's Agent Gateway follows a similar zero-trust mediation model.
My default choice: if you're already on AWS, AgentCore Gateway + AgentCore Runtime, with production services remaining behind private networking and credentials brokered by IAM/secrets infrastructure. If you're cloud-agnostic, I'd build the same architecture around Kubernetes Agent Sandbox + an MCP/tool gateway + workload identity.
The key design principle is: the agent gets capabilities, not credentials. A sandbox alone isn't enough—if the sandbox can read a production token, you've simply moved the secret into a different process.
To securely execute internal tools without exposing production credentials, the industry has converged on a decrypted, multi-layered architecture that separates the agent's reasoning layer ("the brain") from its execution and credential layers ("the hands").
The best infrastructure pattern relies on three core components: Execution Sandboxes, AI-Native Gateways/Proxies , and Credential Brokers (Secrets Brokering).
Watch this overview of production architecture and security sandboxing to see how isolation boundaries contain agent actions:
11:25
Day 3: Secure Tool Integration | Build Production-Grade AI ...2 days ago
YouTube · SystemDR - Scalable System Design
agentgateway or TrueFoundry's Virtual MCP configuration) rather than allowing direct agent-to-API communication . These gateways natively understand protocols like the Model Context Protocol (MCP), enforce least-privilege tool visibility (hiding unauthorized tools entirely from the agent's registry), and handle multiplexing/stateful sessions.Recommended Implementation Blueprint
Isolate the Environment: Spin up an ephemeral microVM per task or tool session with zero initial environment variables or local secrets.
Abstract the Capability: Expose a minimal, restricted tool interface (e.g., a structured local socket or strict RPC) rather than global shell/network access.
Broker the Auth: Pass structured tool requests from the sandbox to an external Gateway/Broker that appends the production credentials on-the-fly.
Sanitize the Response: Strip sensitive metadata or tokens from the tool's return payload before passing the output back into the LLM context window.
To help tailor this design, tell me: