In this post, we show how Skyflow and Amazon Bedrock AgentCore Gateway keep sensitive data out of the tools your AI agents call, and out of the model context those tools feed. We add Skyflow Detect to Amazon Bedrock AgentCore Gateway as a request and response interceptor. The Skyflow interceptor de-identifies data before it reaches a tool, restores it before the agent reads the result, and replaces documents with clean copies before the agent opens them. Your agents and tools don’t change.
Skyflow is available in AWS Marketplace, and the interceptor is open source on GitHub.
Agents act through tools, and tools move data
Agents have moved from answering questions to taking action, and they take action through tools: Model Context Protocol (MCP) servers, SaaS APIs, document stores, and web search. Every agent tool call is a data flow. Most enterprise controls cover what goes into and comes out of the model. Far fewer cover what an agent sends to its tools or what those tools send back.
That gap shows up in three ways:
- Sensitive data leaves through tool arguments. The model writes the arguments from everything in its context, including details the tool doesn’t need. Ask an agent about a customer, and the customer’s name, account number, or email goes straight into a query to a third-party server. That server sits outside your AWS account and your compliance scope.
- Sensitive data comes back in tool results. Scraped web pages, CRM records, and case notes land in the model’s context, memory, traces, and logs. This happens even when the task never needed them.
- Documents bypass text inspection. Document tools such as Amazon Simple Storage Service (Amazon S3), Box, and Google Drive return a signed URL, not text. A filter that inspects strings sees a link and lets it through, and the agent then opens the original file.
Patching each agent doesn’t scale across teams and frameworks, and it can’t reach third-party tools. The controls need to sit where every tool call passes, so authorization, content safety, and data protection apply the same way to every agent and tool.
AgentCore Gateway is that place. It fronts every tool an agent uses, whatever framework or model the agent runs on. It does more than route that traffic. With AgentCore Gateway interceptors, you can run your own code, as an AWS Lambda function, on every call that passes through it. A request interceptor sees each call before it reaches a tool, and a response interceptor sees each result before it reaches the agent. Either one can inspect the payload, rewrite it, or block the call. That makes the gateway a natural place to add data protection alongside Policy and Guardrails. This single control, attached once, covers every agent and every tool behind the gateway, without any change to agent or tool code.
Example: A dispute-resolution agent at a large European bank
Consider a large European bank with retail and corporate banking operations and strict data-residency obligations. Its operations teams are adopting agents to investigate card disputes.
An analyst asks the agent to look into a disputed transaction. The agent searches the web for the merchant, then pulls the dispute case note from Amazon S3 to summarize it. Without protection, three things happen:
- The model builds the search query from everything in context. The search provider receives ‘Mateo Jackson dispute AnyCompany Electronics London’. That’s the customer’s name, sent to a third party, for a search that only needed the merchant.
- Scraped merchant pages bring unrelated personal data into the model’s context.
- The agent reads the original case note, with the customer’s full name, email, phone number, and card details.
With the Skyflow interceptor on the gateway, the same workflow plays out differently:
- The search provider receives ‘[NAME_AJbrIud] dispute AnyCompany Electronics London’, where [NAME_AJbrIud] is a reversible vault token. The merchant results come back the same, the provider never learns who the customer is, and the analyst still sees the real name in the agent’s answer.
- Web content reaches the model already de-identified.
- The agent only ever receives a link to a de-identified copy of the case note.
Solution overview
The Skyflow interceptor is a single AWS Lambda function attached to both of the AgentCore Gateway interception points:
REQUESTruns before the gateway calls a tool.RESPONSEruns after the tool answers and before the agent sees the result.
At each point, it calls Skyflow Detect to find sensitive entities such as names, email addresses, phone numbers, government IDs, card numbers, dates of birth, and locations. It replaces them with tokens, or restores the originals. Skyflow Vault stores the original values so authorized systems can reverse the tokens.
The Skyflow gateway configuration decides, for each tool, which of three protection modes applies: Shield the tool, Shield the model, and Shield the document.
| Mode | What happens | Who sees real data | How it works | Typical use |
| Shield the tool | Sensitive values are stripped from arguments on the way out and restored in results on the way back | The agent and user, not the tool | Uses reversible vault tokens, so values the tool echoes back are restored before the agent reads them | Web search, enrichment, and third-party APIs that don’t need customer identity to do their job |
| Shield the model | Prompts, history, files and tool results are de-identified before the model reads them. The answer is re-identified on the way back | Agent and user, not the model | Model calls go through the gateway’s inference endpoint. On the way back, only the tokens minted for that call are restored | Customer conversations, scraped web content, cross-Region or third-party models |
| Shield the document | The file’s signed URL is swapped for one pointing to a de-identified copy | No one on the agent side | Skyflow Detect v2 (preview) fetches the file, cleans it and stores the copy in an approved Region. The file never passes through Lambda, so payload limits don’t cap file size | Case notes, statements, contracts in Amazon S3, Box, Google Drive |
Four properties matter in production:
- No change to agents or tools. Agents discover the gateway and sign requests with their AWS Identity and Access Management (AWS IAM) role as before. To shield the model, the agent points its model client at the gateway’s inference endpoint. The interceptor is otherwise invisible to them.
- Configuration without redeploys. The policy sets the direction, entity types, and token type (reversible vault tokens or one-way tokens) per server and per tool. It lives in AWS Systems Manager Parameter Store, and changes take effect without redeploying.
- Fail closed. If de-identification can’t complete, the call is withheld rather than sent in the clear. The interceptor fetches files only from allowlisted locations, and it blocks traffic it can’t inspect rather than passing it silently.
- Operations built on AWS. The Skyflow API key lives in AWS Secrets Manager. Every decision is logged to Amazon CloudWatch, with metrics for alarms, and the interceptor never logs credentials or original values.
Architecture
The reference architecture shows where each component sits. The three walkthroughs after it follow a single tool call through the Shield the tool and Shield the document modes.
The following diagram shows how the interceptor sits between AgentCore Gateway and your tools.
The flow:
- The agent calls a tool through AgentCore Gateway, signed with its IAM role.
- The
REQUESTinterceptor matches the tool against the policy and, where required, de-identifies the arguments with Skyflow Detect. - The gateway calls the tool, which receives tokens instead of sensitive values.
- The
RESPONSEinterceptor re-identifies the result, de-identifies it, or swaps a document URL, as the policy requires. - The agent receives the result.
The agent runs on AgentCore runtime, a capability of Amazon Bedrock AgentCore. Alongside that flow, the interceptor reads its policy from Parameter Store and its Skyflow API key from Secrets Manager, and it logs each decision to Amazon CloudWatch. It calls Skyflow Detect and Skyflow Vault in an approved Region to de-identify and re-identify data. The targets sit outside the gateway: a third-party web search MCP server, a case-note store in Amazon S3, and a model in Amazon Bedrock that the gateway reaches through an inference target. For model calls, the interceptor keeps a short-lived record in Amazon DynamoDB of which tokens each call minted, so it restores only those. The record holds no original values. For documents, Skyflow Detect fetches the file directly through a presigned URL, so the file bytes never pass through Lambda.
Walkthrough: Shield the tool
This is the web search from the dispute example, step by step. The customer’s name leaves as a token and comes back as the real value, so the search provider never sees it and the analyst still does.
Figure 2: Shield the tool. The customer name is replaced with a vault token before the search provider sees the query, and restored before the agent reads the results.
Walkthrough: Shield the model
This is the analyst asking the agent to draft a reply to the customer. The customer’s name and email address reach the model as tokens, and the draft comes back with the real values in place.
Figure 3: Shield the model. The interceptor de-identifies the prompt and the conversation history before the model reads them, and restores the tokens it minted for that call before the agent reads the answer.
Walkthrough: Shield the document
This is the case-note request. The interceptor never handles the file itself. It checks the presigned URL and hands it to Skyflow Detect, which returns a link to a clean copy.
Figure 4: Shield the document. The interceptor checks the presigned URL against the allowlist and size limit, Skyflow Detect fetches and de-identifies the file, and the agent receives a link to the clean copy.
Here is the case note as stored in Amazon S3, beside the copy the agent receives:
A token like [NAME_AJbrIud] is a vault token, which an authorized user can reverse through Skyflow. A token like [NAME_1] is a one-way counter that nothing can reverse.
The following video shows Shield the document end to end. The agent asks for the dispute case note and receives a link to a de-identified copy instead of the original.
Video 1: Shield the document in action. Without Skyflow, the agent reads the original case note. With Skyflow on the gateway, it reads a de-identified copy.
How it fits with the rest of AgentCore
The interceptor complements the controls AgentCore and Amazon Bedrock already provide:
- Policy in Amazon Bedrock AgentCore authorizes what agents can do, using Cedar and Dogwood. It goes beyond deciding whether a principal can call a tool. It can base decisions on earlier actions in the agent’s trajectory, control access to agents and models, stop specific arguments from being sent to specific tools, and check the data passing through the gateway using Amazon Bedrock Guardrails. Skyflow works alongside Policy. When Policy allows a call, Skyflow swaps the sensitive values in it for reversible tokens, so the call goes through without exposing real data to the tool or model. Policy decides what an agent may do, and Skyflow controls how sensitive data is handled when it does.
- Amazon Bedrock Guardrails handle content safety and sensitive information redaction for model interactions. Skyflow adds vault-backed tokenization and document de-identification to the same gateway. Use them together for layered protection across every model and tool call.
- AgentCore Identity, a capability of Amazon Bedrock AgentCore, and AWS IAM stay as they are. The interceptor adds no credentials for agents to manage.
- AgentCore Observability, a capability of Amazon Bedrock AgentCore, and Amazon CloudWatch record interceptor decisions alongside gateway traces.
Deploying the solution
The Skyflow interceptor is open source in the agentcore-skyflow repository on GitHub under the MIT license. Skyflow is available in AWS Marketplace. To add the interceptor to a gateway you already run:
- Subscribe to Skyflow in AWS Marketplace, create a vault, and store its API key in AWS Secrets Manager.
- Deploy the interceptor stack from the repository with the AWS Cloud Development Kit (AWS CDK). It creates the Lambda function, its policy parameter, a DynamoDB table for model-call records, and the Amazon CloudWatch metrics and alarms.
- Attach the interceptor to your gateway at both interception points. A script in the repository does this and grants the gateway role permission to invoke only that function. If you manage the gateway with AWS CloudFormation or the AWS CDK, declare the interceptor there instead, so later stack updates keep it.
- To shield the model, add an inference target to the gateway and point the agent’s model client at the gateway’s inference endpoint.
The repository also contains the complete reference deployment from this post, including the agent, the gateway, and its targets, which you can deploy with the AgentCore CLI, a capability of Amazon Bedrock AgentCore.
There are five ways in:
- Existing gateways. Attach the interceptor to a gateway you already run. Agents and tools stay as they are.
- New agents. Put tools behind AgentCore Gateway from day one.
- MCP servers outside AWS. Front them as gateway MCP server targets so their traffic passes through the interceptor.
- Document stores. Tools that return signed URLs are covered by adding their location to the policy’s allowlist.
- Model calls. Add an inference target and send the agent’s model calls through the gateway.
Skyflow offers several vault deployment models and Region choices to meet residency requirements. See Skyflow deployment models.
Considerations
- Formats. Text and Office formats (TXT, JSON, CSV, XML, JSONL, DOCX, XLSX, and PPTX) keep reversible vault tokens. PDFs and images are fully de-identified but receive one-way tokens, so the original values can’t be restored from those files.
- Availability. String de-identification and re-identification are generally available. Document de-identification through signed URLs uses Skyflow Detect v2, which is in preview. AgentCore Gateway availability varies by AWS Region. Before you deploy, check Supported AWS Regions in the Amazon Bedrock AgentCore documentation.
- Document size and latency. Document de-identification is bounded by design. The interceptor checks file size before submitting, so a file above your configured limit is refused immediately rather than timing out. Files within the limit complete within the connection window AgentCore Gateway allows. De-identification time scales with document size, so set the size limit to match your documents. Skyflow Detect v2 is in preview. Validate latency against your own workloads and Region during a pilot, before you widen the rollout.
Conclusion
Agents are only as trustworthy as the data they move. With AgentCore Gateway and the Skyflow interceptor, you can enforce a privacy control at the one place every tool call passes through. It works in both directions, covers documents and text, and needs no change to agent code.
Where to start
- Pick one agent workflow that touches customer data and calls at least one tool outside your account.
- List the entity types that must never leave, and the tools allowed to see them.
- Deploy the interceptor from the GitHub repository and attach it to that workflow’s gateway.
- Start with Shield the tool. Then add Shield the document for your document store, and Shield the model once the agent’s model calls go through the gateway.
- Watch the interceptor’s CloudWatch metrics for a week before widening the rollout.
- If you have further questions, see the Skyflow SDK documentation.




![Physical AI Foundations and Definitions — Ch.10: Future Directions [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgz7t8gzrdba0obh9ma56.png)
![Physical AI Foundations and Definitions — Ch.08: Physical AI Product Strategy [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4gyormoamcida6t18mdw.png)
![Physical AI Foundations and Definitions — Ch.07: Relation to AMR Manipulator Humanoid Quadruped UAV [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fte7aqbjpqzqiay6cht0x.png)
![Physical AI Foundations and Definitions — Ch.05: Physical AI Taxonomy [EN]](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxeb66tbhskewzsz49i7p.png)