[{"data":1,"prerenderedAt":1570},["ShallowReactive",2],{"blog-post-/blogs/private-ai-on-bedrock":3},{"id":4,"title":5,"body":6,"description":1545,"extension":1546,"meta":1547,"navigation":307,"ogImage":1562,"path":1563,"robots":1562,"seo":1564,"sitemap":1565,"stem":1568,"__hash__":1569},"content/blogs/3.private-ai-on-bedrock.md","AI Agents for Regulated Industries: A Private Bedrock Setup",{"type":7,"value":8,"toc":1530},"minimal",[9,13,21,24,27,30,35,38,95,98,102,113,125,131,142,148,154,158,161,168,218,222,225,236,240,251,467,470,526,540,546,926,935,940,948,952,955,961,964,968,974,980,1054,1058,1061,1091,1097,1100,1135,1138,1141,1145,1151,1155,1158,1174,1177,1197,1200,1204,1210,1214,1220,1262,1266,1272,1276,1279,1305,1308,1390,1393,1397,1403,1407,1410,1423,1427,1511,1515,1518,1526],[10,11,5],"h1",{"id":12},"ai-agents-for-regulated-industries-a-private-bedrock-setup",[14,15,16,17],"p",{},"The demo went well, and the team wants the agent in production. Then someone asks one question, and everything stops: ",[18,19,20],"em",{},"where does our customer data go?",[14,22,23],{},"In an industry where data is tightly regulated, that question comes in three parts. Does the data cross the public internet? Does anyone store it? Will it train someone else's model?",[14,25,26],{},"On AWS, Amazon Bedrock can answer no to all three. Most of that is the default. The rest comes down to a few settings, and to a handful of catches that can quietly break the promise if nobody's watching.",[14,28,29],{},"This article covers what AWS actually commits to, where the catches are, and six steps that turn \"AWS says so\" into proof you can show an auditor.",[31,32,34],"h2",{"id":33},"what-aws-actually-promises","What AWS Actually Promises",[14,36,37],{},"Here's what AWS commits to in writing. Each point links to the page that says it:",[39,40,41,57,73,84],"ul",{},[42,43,44,48,49],"li",{},[45,46,47],"strong",{},"Training."," Neither AWS nor the third-party model providers use your Bedrock inputs or outputs to train their models, whether those are Amazon's own or third-party ones.",[50,51,56],"a",{"href":52,"rel":53,"className":55},"https://aws.amazon.com/bedrock/faqs/",[54],"nofollow",[56],"source",[42,58,59,62,63,67,68],{},[45,60,61],{},"Model providers."," Your inputs and outputs aren't shared with any model provider.",[50,64,56],{"href":52,"rel":65,"className":66},[54],[56]," Each provider's models run in AWS-owned accounts the provider has no access to, so Anthropic, OpenAI and the rest never see your prompts or logs.",[50,69,56],{"href":70,"rel":71,"className":72},"https://docs.aws.amazon.com/bedrock/latest/userguide/data-protection.html",[54],[56],[42,74,75,78,79],{},[45,76,77],{},"Storage."," By default, Bedrock doesn't store your inputs or outputs, and no operator of the service can access them.",[50,80,56],{"href":81,"rel":82,"className":83},"https://docs.aws.amazon.com/bedrock/latest/userguide/abuse-detection.html",[54],[56],[42,85,86,89,90],{},[45,87,88],{},"Network."," Traffic between your resources and AWS services stays on AWS's private network, even when you call a public endpoint. The exceptions are traffic to or from the AWS China Regions and the AWS European Sovereign Cloud Region.",[50,91,56],{"href":92,"rel":93,"className":94},"https://aws.amazon.com/vpc/faqs/",[54],[56],[14,96,97],{},"Notice the \"by default\" in the storage promise. That's where the catches start.",[31,99,101],{"id":100},"the-catches","The Catches",[14,103,104,107,108,112],{},[45,105,106],{},"1. Some models require retention."," A handful of models on Bedrock need AWS to keep your data for abuse detection. Depending on the model, AWS keeps either all traffic or only flagged requests for up to 30 days, and for some models it may review flagged requests by hand. The retained data stays inside AWS and isn't shared with the provider, but it is stored. The list changes, so check ",[50,109,111],{"href":81,"rel":110},[54],"the current one",".",[14,114,115,118,119,124],{},[45,116,117],{},"2. A default can be changed."," Bedrock has a ",[50,120,123],{"href":121,"rel":122},"https://docs.aws.amazon.com/bedrock/latest/userguide/data-retention.html",[54],"data retention setting",". If a developer wants to try one of those newer models, they can switch it to a mode that allows retention, and from then on the promise no longer holds.",[14,126,127,130],{},[45,128,129],{},"3. Cross-region inference can move processing."," Inference profiles send requests to other Regions when yours is busy. A geographic profile keeps processing within an area like the EU; a global profile can use any supported Region in the world. For models that retain data, AWS stores the retained copy in the Region that processed the request.",[14,132,133,136,137,141],{},[45,134,135],{},"4. Your own setup can store data."," Model invocation logging, the Responses API's ",[138,139,140],"code",{},"store"," option, knowledge bases, and your application's own logs all keep copies of prompts and responses. They're yours, but they still count.",[14,143,144,147],{},[45,145,146],{},"5. Your users aren't on AWS."," Traffic from your users and on-prem systems to your AWS account crosses the internet, encrypted with TLS, unless it comes in over a VPN or Direct Connect.",[14,149,150,153],{},[45,151,152],{},"6. Agents decide where data goes."," An agent calls tools, and a tool that calls a third-party API sends your customer data to that third party, outside everything Bedrock promises. The model never needs to leak anything for this to happen; the agent just has to pick that tool.",[31,155,157],{"id":156},"the-target-setup","The Target Setup",[14,159,160],{},"Here's what you end up with once the six steps below are done:",[14,162,163],{},[164,165],"img",{"alt":166,"src":167},"The AI agent runs in private subnets with no route to the internet, reaches Amazon Bedrock through PrivateLink endpoints, organization policies keep Bedrock's data retention at none and block global inference, and a guardrail masks personal data","/articles/private-ai-on-bedrock/architecture.png",[39,169,170,176,183,197,204,211],{},[42,171,172,173,112],{},"The agent runs in ",[45,174,175],{},"private subnets with no route to the internet",[42,177,178,179,182],{},"It reaches Bedrock, and every other AWS service it needs, through ",[45,180,181],{},"VPC endpoints",". That traffic stays on AWS's network by design, not by routing policy. With no route out, the agent's tools can only reach what you've explicitly connected, which also takes care of catch 6.",[42,184,185,186,192,193,196],{},"Bedrock's ",[45,187,188,189],{},"retention mode is ",[138,190,191],{},"none",", and an ",[45,194,195],{},"organization-wide policy"," stops anyone from changing it.",[42,198,199,200,203],{},"Models run ",[45,201,202],{},"in your Region or a geography you've approved",", and global routing is blocked.",[42,205,206,207,210],{},"A ",[45,208,209],{},"guardrail masks personal data"," the model doesn't need.",[42,212,213,214,217],{},"The only copies of prompts and responses are ",[45,215,216],{},"your own logs",", encrypted and with a retention limit.",[31,219,221],{"id":220},"how-to-use-the-prompts-in-this-article","How to Use the Prompts in This Article",[14,223,224],{},"You'll probably have an AI coding agent such as Claude Code, Cursor or GitHub Copilot write the infrastructure, so instead of templates, most steps end with a prompt for it. Run each prompt in your infrastructure repository, and the agent will write it in whatever tool you already use: Terraform, CDK or CloudFormation.",[14,226,227,228,231,232,235],{},"The prompts state the requirements and how to check the result, because those are the parts that matter. Review what the agent produces (",[138,229,230],{},"terraform plan",", ",[138,233,234],{},"cdk diff",") before applying it. It's still a change to your production network.",[31,237,239],{"id":238},"step-1-turn-off-retention-and-lock-it","Step 1: Turn Off Retention, and Lock It",[14,241,242,243,245,246,250],{},"Set the retention mode to ",[138,244,191],{},". In this mode, AWS writes no request or response data to durable storage and shares none with the model provider.",[50,247,56],{"href":121,"rel":248,"className":249},[54],[56]," The setting is per Region and there's no console screen for it yet, so run this in every Region you call Bedrock from:",[252,253,258],"pre",{"className":254,"code":255,"language":256,"meta":257,"style":257},"language-bash shiki shiki-themes dracula","REGION=\"${AWS_REGION:?set AWS_REGION first}\"\n\n# Bedrock Mantle endpoint (Messages, Chat Completions and Responses APIs)\ncurl -X PUT \"https://bedrock-mantle.${REGION}.api.aws/v1/data_retention\" \\\n  -H \"x-api-key: $BEDROCK_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"mode\": \"none\"}'\n\n# bedrock-runtime endpoint (InvokeModel, Converse), set through the control plane\ncurl -X PUT \"https://bedrock.${REGION}.amazonaws.com/data-retention\" \\\n  -H \"Authorization: Bearer $AWS_BEARER_TOKEN_BEDROCK\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"mode\": \"none\"}'\n","bash","",[138,259,260,302,309,316,345,363,377,392,397,403,426,443,456],{"__ignoreMap":257},[261,262,265,269,273,277,281,284,287,290,293,296,299],"span",{"class":263,"line":264},"line",1,[261,266,268],{"class":267},"sIQBb","REGION",[261,270,272],{"class":271},"s0Tla","=",[261,274,276],{"class":275},"seVfx","\"",[261,278,280],{"class":279},"s-mGx","${",[261,282,283],{"class":267},"AWS_REGION",[261,285,286],{"class":271},":?",[261,288,289],{"class":267},"set",[261,291,292],{"class":267}," AWS_REGION",[261,294,295],{"class":267}," first",[261,297,298],{"class":279},"}",[261,300,301],{"class":275},"\"\n",[261,303,305],{"class":263,"line":304},2,[261,306,308],{"emptyLinePlaceholder":307},true,"\n",[261,310,312],{"class":263,"line":311},3,[261,313,315],{"class":314},"shSDL","# Bedrock Mantle endpoint (Messages, Chat Completions and Responses APIs)\n",[261,317,319,323,326,329,332,335,337,340,342],{"class":263,"line":318},4,[261,320,322],{"class":321},"sAOxA","curl",[261,324,325],{"class":267}," -X",[261,327,328],{"class":279}," PUT",[261,330,331],{"class":275}," \"",[261,333,334],{"class":279},"https://bedrock-mantle.${",[261,336,268],{"class":267},[261,338,339],{"class":279},"}.api.aws/v1/data_retention",[261,341,276],{"class":275},[261,343,344],{"class":271}," \\\n",[261,346,348,351,353,356,359,361],{"class":263,"line":347},5,[261,349,350],{"class":267},"  -H",[261,352,331],{"class":275},[261,354,355],{"class":279},"x-api-key: ",[261,357,358],{"class":267},"$BEDROCK_API_KEY",[261,360,276],{"class":275},[261,362,344],{"class":271},[261,364,366,368,370,373,375],{"class":263,"line":365},6,[261,367,350],{"class":267},[261,369,331],{"class":275},[261,371,372],{"class":279},"Content-Type: application/json",[261,374,276],{"class":275},[261,376,344],{"class":271},[261,378,380,383,386,389],{"class":263,"line":379},7,[261,381,382],{"class":267},"  -d",[261,384,385],{"class":275}," '",[261,387,388],{"class":279},"{\"mode\": \"none\"}",[261,390,391],{"class":275},"'\n",[261,393,395],{"class":263,"line":394},8,[261,396,308],{"emptyLinePlaceholder":307},[261,398,400],{"class":263,"line":399},9,[261,401,402],{"class":314},"# bedrock-runtime endpoint (InvokeModel, Converse), set through the control plane\n",[261,404,406,408,410,412,414,417,419,422,424],{"class":263,"line":405},10,[261,407,322],{"class":321},[261,409,325],{"class":267},[261,411,328],{"class":279},[261,413,331],{"class":275},[261,415,416],{"class":279},"https://bedrock.${",[261,418,268],{"class":267},[261,420,421],{"class":279},"}.amazonaws.com/data-retention",[261,423,276],{"class":275},[261,425,344],{"class":271},[261,427,429,431,433,436,439,441],{"class":263,"line":428},11,[261,430,350],{"class":267},[261,432,331],{"class":275},[261,434,435],{"class":279},"Authorization: Bearer ",[261,437,438],{"class":267},"$AWS_BEARER_TOKEN_BEDROCK",[261,440,276],{"class":275},[261,442,344],{"class":271},[261,444,446,448,450,452,454],{"class":263,"line":445},12,[261,447,350],{"class":267},[261,449,331],{"class":275},[261,451,372],{"class":279},[261,453,276],{"class":275},[261,455,344],{"class":271},[261,457,459,461,463,465],{"class":263,"line":458},13,[261,460,382],{"class":267},[261,462,385],{"class":275},[261,464,388],{"class":279},[261,466,391],{"class":275},[14,468,469],{},"Models that require retention now show up as unavailable instead of quietly storing your data. To check a specific model, ask for its retention status:",[252,471,473],{"className":254,"code":472,"language":256,"meta":257,"style":257},"MODEL_ID=\"\u003Cthe model ID you call>\"\n\ncurl \"https://bedrock-mantle.${REGION}.api.aws/v1/models/${MODEL_ID}\" \\\n  -H \"x-api-key: $BEDROCK_API_KEY\"\n",[138,474,475,489,493,514],{"__ignoreMap":257},[261,476,477,480,482,484,487],{"class":263,"line":264},[261,478,479],{"class":267},"MODEL_ID",[261,481,272],{"class":271},[261,483,276],{"class":275},[261,485,486],{"class":279},"\u003Cthe model ID you call>",[261,488,301],{"class":275},[261,490,491],{"class":263,"line":304},[261,492,308],{"emptyLinePlaceholder":307},[261,494,495,497,499,501,503,506,508,510,512],{"class":263,"line":311},[261,496,322],{"class":321},[261,498,331],{"class":275},[261,500,334],{"class":279},[261,502,268],{"class":267},[261,504,505],{"class":279},"}.api.aws/v1/models/${",[261,507,479],{"class":267},[261,509,298],{"class":279},[261,511,276],{"class":275},[261,513,344],{"class":271},[261,515,516,518,520,522,524],{"class":263,"line":318},[261,517,350],{"class":267},[261,519,331],{"class":275},[261,521,355],{"class":279},[261,523,358],{"class":267},[261,525,301],{"class":275},[14,527,528,529,532,533,536,537,539],{},"The response has a ",[138,530,531],{},"data_retention"," block. If ",[138,534,535],{},"allowed_modes"," includes ",[138,538,191],{},", the model is usable with zero retention.",[14,541,542,543,545],{},"Then make sure nobody can change it. This service control policy (SCP), adapted from AWS's docs, denies any attempt to set a mode other than ",[138,544,191],{}," anywhere in your AWS organization:",[252,547,551],{"className":548,"code":549,"language":550,"meta":257,"style":257},"language-json shiki shiki-themes dracula","{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Sid\": \"RequireZeroRetentionMantle\",\n      \"Effect\": \"Deny\",\n      \"Action\": [\n        \"bedrock-mantle:PutAccountDataRetention\",\n        \"bedrock-mantle:CreateProject\",\n        \"bedrock-mantle:UpdateProject\"\n      ],\n      \"Resource\": \"*\",\n      \"Condition\": {\n        \"StringNotEquals\": { \"bedrock-mantle:DataRetentionMode\": \"none\" }\n      }\n    },\n    {\n      \"Sid\": \"RequireZeroRetentionControlPlane\",\n      \"Effect\": \"Deny\",\n      \"Action\": [\"bedrock:PutAccountDataRetention\"],\n      \"Resource\": \"*\",\n      \"Condition\": {\n        \"StringNotEquals\": { \"bedrock:DataRetentionMode\": \"none\" }\n      }\n    }\n  ]\n}\n","json",[138,552,553,559,584,598,603,624,644,657,669,680,689,694,714,728,761,767,773,778,798,817,841,860,873,903,908,914,920],{"__ignoreMap":257},[261,554,555],{"class":263,"line":264},[261,556,558],{"class":557},"sCdxs","{\n",[261,560,561,565,569,571,574,576,579,581],{"class":263,"line":304},[261,562,564],{"class":563},"sY8FZ","  \"",[261,566,568],{"class":567},"sLL85","Version",[261,570,276],{"class":563},[261,572,573],{"class":271},":",[261,575,331],{"class":275},[261,577,578],{"class":279},"2012-10-17",[261,580,276],{"class":275},[261,582,583],{"class":557},",\n",[261,585,586,588,591,593,595],{"class":263,"line":311},[261,587,564],{"class":563},[261,589,590],{"class":567},"Statement",[261,592,276],{"class":563},[261,594,573],{"class":271},[261,596,597],{"class":557}," [\n",[261,599,600],{"class":263,"line":318},[261,601,602],{"class":557},"    {\n",[261,604,605,608,611,613,615,617,620,622],{"class":263,"line":347},[261,606,607],{"class":563},"      \"",[261,609,610],{"class":567},"Sid",[261,612,276],{"class":563},[261,614,573],{"class":271},[261,616,331],{"class":275},[261,618,619],{"class":279},"RequireZeroRetentionMantle",[261,621,276],{"class":275},[261,623,583],{"class":557},[261,625,626,628,631,633,635,637,640,642],{"class":263,"line":365},[261,627,607],{"class":563},[261,629,630],{"class":567},"Effect",[261,632,276],{"class":563},[261,634,573],{"class":271},[261,636,331],{"class":275},[261,638,639],{"class":279},"Deny",[261,641,276],{"class":275},[261,643,583],{"class":557},[261,645,646,648,651,653,655],{"class":263,"line":379},[261,647,607],{"class":563},[261,649,650],{"class":567},"Action",[261,652,276],{"class":563},[261,654,573],{"class":271},[261,656,597],{"class":557},[261,658,659,662,665,667],{"class":263,"line":394},[261,660,661],{"class":275},"        \"",[261,663,664],{"class":279},"bedrock-mantle:PutAccountDataRetention",[261,666,276],{"class":275},[261,668,583],{"class":557},[261,670,671,673,676,678],{"class":263,"line":399},[261,672,661],{"class":275},[261,674,675],{"class":279},"bedrock-mantle:CreateProject",[261,677,276],{"class":275},[261,679,583],{"class":557},[261,681,682,684,687],{"class":263,"line":405},[261,683,661],{"class":275},[261,685,686],{"class":279},"bedrock-mantle:UpdateProject",[261,688,301],{"class":275},[261,690,691],{"class":263,"line":428},[261,692,693],{"class":557},"      ],\n",[261,695,696,698,701,703,705,707,710,712],{"class":263,"line":445},[261,697,607],{"class":563},[261,699,700],{"class":567},"Resource",[261,702,276],{"class":563},[261,704,573],{"class":271},[261,706,331],{"class":275},[261,708,709],{"class":279},"*",[261,711,276],{"class":275},[261,713,583],{"class":557},[261,715,716,718,721,723,725],{"class":263,"line":458},[261,717,607],{"class":563},[261,719,720],{"class":567},"Condition",[261,722,276],{"class":563},[261,724,573],{"class":271},[261,726,727],{"class":557}," {\n",[261,729,731,733,736,738,740,743,745,748,750,752,754,756,758],{"class":263,"line":730},14,[261,732,661],{"class":563},[261,734,735],{"class":567},"StringNotEquals",[261,737,276],{"class":563},[261,739,573],{"class":271},[261,741,742],{"class":557}," { ",[261,744,276],{"class":563},[261,746,747],{"class":567},"bedrock-mantle:DataRetentionMode",[261,749,276],{"class":563},[261,751,573],{"class":271},[261,753,331],{"class":275},[261,755,191],{"class":279},[261,757,276],{"class":275},[261,759,760],{"class":557}," }\n",[261,762,764],{"class":263,"line":763},15,[261,765,766],{"class":557},"      }\n",[261,768,770],{"class":263,"line":769},16,[261,771,772],{"class":557},"    },\n",[261,774,776],{"class":263,"line":775},17,[261,777,602],{"class":557},[261,779,781,783,785,787,789,791,794,796],{"class":263,"line":780},18,[261,782,607],{"class":563},[261,784,610],{"class":567},[261,786,276],{"class":563},[261,788,573],{"class":271},[261,790,331],{"class":275},[261,792,793],{"class":279},"RequireZeroRetentionControlPlane",[261,795,276],{"class":275},[261,797,583],{"class":557},[261,799,801,803,805,807,809,811,813,815],{"class":263,"line":800},19,[261,802,607],{"class":563},[261,804,630],{"class":567},[261,806,276],{"class":563},[261,808,573],{"class":271},[261,810,331],{"class":275},[261,812,639],{"class":279},[261,814,276],{"class":275},[261,816,583],{"class":557},[261,818,820,822,824,826,828,831,833,836,838],{"class":263,"line":819},20,[261,821,607],{"class":563},[261,823,650],{"class":567},[261,825,276],{"class":563},[261,827,573],{"class":271},[261,829,830],{"class":557}," [",[261,832,276],{"class":275},[261,834,835],{"class":279},"bedrock:PutAccountDataRetention",[261,837,276],{"class":275},[261,839,840],{"class":557},"],\n",[261,842,844,846,848,850,852,854,856,858],{"class":263,"line":843},21,[261,845,607],{"class":563},[261,847,700],{"class":567},[261,849,276],{"class":563},[261,851,573],{"class":271},[261,853,331],{"class":275},[261,855,709],{"class":279},[261,857,276],{"class":275},[261,859,583],{"class":557},[261,861,863,865,867,869,871],{"class":263,"line":862},22,[261,864,607],{"class":563},[261,866,720],{"class":567},[261,868,276],{"class":563},[261,870,573],{"class":271},[261,872,727],{"class":557},[261,874,876,878,880,882,884,886,888,891,893,895,897,899,901],{"class":263,"line":875},23,[261,877,661],{"class":563},[261,879,735],{"class":567},[261,881,276],{"class":563},[261,883,573],{"class":271},[261,885,742],{"class":557},[261,887,276],{"class":563},[261,889,890],{"class":567},"bedrock:DataRetentionMode",[261,892,276],{"class":563},[261,894,573],{"class":271},[261,896,331],{"class":275},[261,898,191],{"class":279},[261,900,276],{"class":275},[261,902,760],{"class":557},[261,904,906],{"class":263,"line":905},24,[261,907,766],{"class":557},[261,909,911],{"class":263,"line":910},25,[261,912,913],{"class":557},"    }\n",[261,915,917],{"class":263,"line":916},26,[261,918,919],{"class":557},"  ]\n",[261,921,923],{"class":263,"line":922},27,[261,924,925],{"class":557},"}\n",[14,927,928,929,934],{},"SCPs don't apply to your organization's management account, so don't run workloads there. Keep Bedrock in member accounts, where the policy holds. And if your organization was created through AWS's new simplified sign-up, AWS manages its SCPs for you: you'll need to ",[50,930,933],{"href":931,"rel":932},"https://docs.aws.amazon.com/accounts/latest/reference/activate-advanced-features.html",[54],"activate advanced features"," before you can add your own, and that can't be undone.",[14,936,937],{},[45,938,939],{},"Prompt for your AI agent:",[252,941,946],{"className":942,"code":944,"language":945,"meta":257},[943],"language-text","Add an AWS Organizations service control policy to our infrastructure code\nusing the policy JSON below, and attach it to the organizational unit that\ncontains our workload accounts.\n\n\u003Cpaste the policy JSON>\n\nBefore you finish:\n- Confirm the management account is not in that OU and runs no Bedrock workloads.\n- List every account the policy now applies to.\n- Show me the plan or diff before anything is applied.\n","text",[138,947,944],{"__ignoreMap":257},[31,949,951],{"id":950},"step-2-remove-the-route-to-the-internet","Step 2: Remove the Route to the Internet",[14,953,954],{},"AWS already keeps the traffic on its own network. But \"AWS routes it privately\" is a weaker answer for an auditor than \"there is no route to the internet at all\", and the second one is easy to build.",[14,956,957,958,112],{},"The agent runs in private subnets whose route tables have no internet gateway, no NAT and no egress-only gateway for IPv6. It reaches Bedrock through interface VPC endpoints (AWS PrivateLink). With private DNS turned on for the endpoints, Bedrock's usual hostnames resolve to private IPs inside your VPC, so ",[45,959,960],{},"the agent's code doesn't change at all",[14,962,963],{},"Without NAT, every other AWS service the agent uses needs its own endpoint too, and your coding agent can find them for you. The upside is that every service the agent can reach is now listed in your infrastructure code.",[14,965,966],{},[45,967,939],{},[252,969,972],{"className":970,"code":971,"language":945,"meta":257},[943],"Make the network for our AI agent private. Use the IaC tool this repository\nalready uses, and don't change anything unrelated.\n\n1. Run the agent in private subnets. Their route tables must have no route\n   to an internet gateway, NAT gateway or egress-only internet gateway: no\n   0.0.0.0/0 and no ::/0.\n2. Create interface VPC endpoints with private DNS enabled for\n   com.amazonaws.\u003Cregion>.bedrock-mantle and com.amazonaws.\u003Cregion>.bedrock-runtime,\n   in the agent's subnets.\n3. Endpoint policies must allow only the agent's IAM role:\n   - bedrock-mantle: the action bedrock-mantle:CreateInference\n   - bedrock-runtime: bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream\n4. The endpoints' security group accepts HTTPS (443) only from the agent's\n   security group.\n5. Add an endpoint for every other AWS service the agent needs to start and\n   run without NAT. Search the application code and the deployment setup to\n   find them, and list what you found.\n\nWhen you're done, list every route table, endpoint and security group you\ncreated or changed, and show how you confirmed that the agent's subnets have\nno route to the internet.\n",[138,973,971],{"__ignoreMap":257},[14,975,976,979],{},[45,977,978],{},"Then check it from inside the VPC."," Run this from the agent's subnets:",[252,981,983],{"className":254,"code":982,"language":256,"meta":257,"style":257},"# Should print private 10.x addresses, not public ones\ngetent hosts \"bedrock-mantle.${AWS_REGION}.api.aws\"\n\n# Should fail: there's no route to the internet\ncurl -sS -m 5 https://example.com > /dev/null && echo \"LEAK: internet egress is open\"\n",[138,984,985,990,1010,1014,1019],{"__ignoreMap":257},[261,986,987],{"class":263,"line":264},[261,988,989],{"class":314},"# Should print private 10.x addresses, not public ones\n",[261,991,992,995,998,1000,1003,1005,1008],{"class":263,"line":304},[261,993,994],{"class":321},"getent",[261,996,997],{"class":279}," hosts",[261,999,331],{"class":275},[261,1001,1002],{"class":279},"bedrock-mantle.${",[261,1004,283],{"class":267},[261,1006,1007],{"class":279},"}.api.aws",[261,1009,301],{"class":275},[261,1011,1012],{"class":263,"line":311},[261,1013,308],{"emptyLinePlaceholder":307},[261,1015,1016],{"class":263,"line":318},[261,1017,1018],{"class":314},"# Should fail: there's no route to the internet\n",[261,1020,1021,1023,1026,1029,1032,1035,1038,1041,1044,1047,1049,1052],{"class":263,"line":347},[261,1022,322],{"class":321},[261,1024,1025],{"class":267}," -sS",[261,1027,1028],{"class":267}," -m",[261,1030,1031],{"class":267}," 5",[261,1033,1034],{"class":279}," https://example.com",[261,1036,1037],{"class":271}," >",[261,1039,1040],{"class":279}," /dev/null",[261,1042,1043],{"class":557}," && ",[261,1045,1046],{"class":567},"echo",[261,1048,331],{"class":275},[261,1050,1051],{"class":279},"LEAK: internet egress is open",[261,1053,301],{"class":275},[31,1055,1057],{"id":1056},"step-3-keep-processing-where-your-data-is-allowed","Step 3: Keep Processing Where Your Data Is Allowed",[14,1059,1060],{},"Regulators care where data is processed, not only where it's stored. Bedrock gives you three options for each model:",[39,1062,1063,1069,1082],{},[42,1064,1065,1068],{},[45,1066,1067],{},"In-Region:"," the request is processed in the Region you call.",[42,1070,1071,1074,1075,231,1078,1081],{},[45,1072,1073],{},"Geographic:"," Bedrock may route the request to other Regions in one geography, such as the EU. These profile IDs start with ",[138,1076,1077],{},"eu.",[138,1079,1080],{},"us."," and so on.",[42,1083,1084,1087,1088,112],{},[45,1085,1086],{},"Global:"," the request can be processed in any supported commercial Region in the world. These profile IDs start with ",[138,1089,1090],{},"global.",[14,1092,1093,1094,1096],{},"Availability differs per model, so check before you design around it. A model may run In-Region in only one or two European Regions, and everywhere else you reach it through its ",[138,1095,1077],{}," profile.",[14,1098,1099],{},"For a regulated workload, the details of that geographic profile matter:",[39,1101,1102,1117,1129],{},[42,1103,1104,1107,1108,1110,1111,1116],{},[45,1105,1106],{},"Where it goes depends on where you call it from."," A model's ",[138,1109,1077],{}," profile can route only between EU Regions when called from Frankfurt or Paris, but add London when called from London, or Zurich when called from Zurich. If your rule is \"EU member states only\", call it from an EU Region. Call ",[50,1112,1115],{"href":1113,"rel":1114},"https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetInferenceProfile.html",[54],"GetInferenceProfile"," from your source Region to get the exact list, and keep the output with your evidence.",[42,1118,1119,1122,1123,1128],{},[45,1120,1121],{},"That list won't change under you."," AWS never changes a geographic profile's destination Regions: when it adds Regions, it creates a new profile instead.",[50,1124,56],{"href":1125,"rel":1126,"className":1127},"https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-support.html",[54],[56]," The list you approve stays the list.",[42,1130,1131,1134],{},[45,1132,1133],{},"Your Region restrictions must include every destination."," If an SCP only allows your home Region, calls through a geographic profile will fail. Allow every destination Region in the profile.",[14,1136,1137],{},"Then block global profiles with an SCP, so nobody switches to one to get more capacity.",[14,1139,1140],{},"If you're in the AWS European Sovereign Cloud, note that it's one of the exceptions to AWS's \"stays on our network\" rule. That makes the private network from Step 2 more important there, not less.",[14,1142,1143],{},[45,1144,939],{},[252,1146,1149],{"className":1147,"code":1148,"language":945,"meta":257},[943],"Write a service control policy for our workload accounts that denies Amazon\nBedrock inference through global cross-region inference profiles (IDs that\nstart with \"global.\") but still allows in-Region model calls and EU\ngeographic profiles (IDs that start with \"eu.\").\n\nBase it on AWS's guidance here:\nhttps://aws.amazon.com/blogs/machine-learning/securing-amazon-bedrock-cross-region-inference-geographic-and-global/\nIt matches global requests with aws:RequestedRegion \"unspecified\" together\nwith bedrock:InferenceProfileArn matching the global.* profile ARNs. Do not\nadd \"unspecified\" to any Region deny list.\n\nCheck every action, condition key and ARN format against the current AWS\ndocumentation, and tell me where each one is documented. If we already have\nan SCP that restricts Regions, make sure it allows every destination Region\nof the eu. profiles we use. Then write a test for our sandbox account: a\nrequest using a global profile must be denied, and a request using an eu.\nprofile must succeed.\n",[138,1150,1148],{"__ignoreMap":257},[31,1152,1154],{"id":1153},"step-4-send-the-model-only-the-personal-data-it-needs","Step 4: Send the Model Only the Personal Data It Needs",[14,1156,1157],{},"The setup so far controls where data goes. Data minimization, a core GDPR principle and the idea behind HIPAA's \"minimum necessary\" standard, asks a different question: does the model need to see that customer's name, IBAN or health number at all? Usually it doesn't.",[14,1159,1160,1165,1166,1169,1170,1173],{},[50,1161,1164],{"href":1162,"rel":1163},"https://docs.aws.amazon.com/bedrock/latest/userguide/guardrails-sensitive-filters.html",[54],"Bedrock Guardrails"," can check prompts and responses for personal data, then either block the request or mask the data, replacing it with its type, such as ",[138,1167,1168],{},"{NAME}"," or ",[138,1171,1172],{},"{EMAIL}",". The built-in types include names, addresses, email addresses, phone numbers, card numbers, IBANs, SWIFT codes and UK NHS numbers. For your own identifiers, such as customer or policy numbers, you add regular expressions.",[14,1175,1176],{},"Three limits matter for agents:",[39,1178,1179,1185,1191],{},[42,1180,1181,1184],{},[45,1182,1183],{},"It's detection, not a guarantee."," The filter is a machine learning model that judges by context. Treat it as a safety net on top of your other controls.",[42,1186,1187,1190],{},[45,1188,1189],{},"It doesn't check tool calls."," The filter evaluates text only. It doesn't look at the arguments the model passes to your tools, the results your tools send back, or the tool definitions. In an agent, that's where much of the customer data flows, so redact in your tool code before results go back to the model.",[42,1192,1193,1196],{},[45,1194,1195],{},"Masking doesn't reach your logs."," Model invocation logs always contain the original, unmasked prompt, and the guardrail's trace output contains the original values by design. Step 5 covers how to handle both.",[14,1198,1199],{},"If you turn on cross-Region inference for the guardrail itself, choose a guardrail profile whose destination Regions match the rules from Step 3.",[14,1201,1202],{},[45,1203,939],{},[252,1205,1208],{"className":1206,"code":1207,"language":945,"meta":257},[943],"Add an Amazon Bedrock guardrail to our AI agent that masks personal data in\nmodel inputs and outputs. Use the IaC tool this repository already uses.\n\n1. Create the guardrail with sensitive information filters in mask mode for\n   these PII types: \u003Clist the types your data contains, e.g. NAME, EMAIL,\n   PHONE, ADDRESS, INTERNATIONAL_BANK_ACCOUNT_NUMBER>. Add regex filters for\n   our own identifiers: \u003Ce.g. customer IDs like CUS-\\d{8}>.\n2. Encrypt the guardrail with our customer-managed KMS key.\n3. Apply the guardrail to every model call the agent makes. Check that\n   guardrails are supported on the Bedrock API and endpoint our code uses.\n4. Update the agent's IAM role and the VPC endpoint policies from our\n   private network setup with the permissions guardrails need, checked\n   against the AWS documentation.\n5. Find every tool the agent can call. List the personal data each one\n   receives from the model and returns to it, since the guardrail doesn't\n   check tool inputs or outputs, and propose where to redact it.\n\nDon't log the guardrail's trace output unredacted: it contains the original\nvalues. Show me the plan or diff before anything is applied.\n",[138,1209,1207],{"__ignoreMap":257},[31,1211,1213],{"id":1212},"step-5-control-what-you-store-yourself","Step 5: Control What You Store Yourself",[14,1215,1216,1217,1219],{},"With retention at ",[138,1218,191],{},", AWS stores nothing. Your own account is a different matter:",[39,1221,1222,1234,1250,1256],{},[42,1223,1224,1227,1228,1233],{},[45,1225,1226],{},"Model invocation logging"," is off by default. If you turn it on for debugging or audit, it writes full prompts and responses to your S3 bucket or CloudWatch Logs, unmasked even when a guardrail masked them. Encrypt them with your own KMS key, set a retention period, restrict who can read them, and consider ",[50,1229,1232],{"href":1230,"rel":1231},"https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html",[54],"CloudWatch Logs data protection"," to mask personal data in log groups.",[42,1235,1236,1242,1243,1245,1246,1249],{},[45,1237,1238,1239,1241],{},"The Responses API's ",[138,1240,140],{}," option"," keeps responses for later retrieval. Under ",[138,1244,191],{},", requests with ",[138,1247,1248],{},"store=true"," are rejected, which is what you want.",[42,1251,1252,1255],{},[45,1253,1254],{},"Your application's logs and traces"," contain the same prompts and tool results. Give them a retention limit and redact what you don't need.",[42,1257,1258,1261],{},[45,1259,1260],{},"Knowledge bases and vector stores"," hold your documents and their embeddings in your account. Encrypt them like any other data store.",[14,1263,1264],{},[45,1265,939],{},[252,1267,1270],{"className":1268,"code":1269,"language":945,"meta":257},[943],"Find every place in this codebase and its infrastructure where model prompts,\nmodel responses or tool results can be stored. Include application logs,\ntracing, error reporting, Bedrock model invocation logging, S3 buckets,\nCloudWatch log groups, databases and vector stores.\n\nFor each one, report: what is stored, where, whether it's encrypted with a\ncustomer-managed KMS key, its retention period, and who can read it. Include\nguardrail trace output if we log it. Flag anything with no retention limit,\nno encryption, broad read access, unmasked personal data, or that sends data\nto a service outside our AWS account. Don't change anything yet; I'll review\nthe report first.\n",[138,1271,1269],{"__ignoreMap":257},[31,1273,1275],{"id":1274},"step-6-prove-it","Step 6: Prove It",[14,1277,1278],{},"Configuration drifts, so turn each promise into evidence you can check:",[39,1280,1281,1287,1292],{},[42,1282,1283,1286],{},[45,1284,1285],{},"Retention."," Alert on any attempt to change the retention setting. With the SCP in place, every attempt should be denied, and an attempt still tells you someone tried.",[42,1288,1289,1291],{},[45,1290,88],{}," Turn on VPC Flow Logs for the agent's subnets. They should show no traffic to public IP addresses.",[42,1293,1294,1297,1298,1169,1301,1304],{},[45,1295,1296],{},"Routes."," Run a recurring check that the agent's route tables have no ",[138,1299,1300],{},"0.0.0.0/0",[138,1302,1303],{},"::/0"," route.",[14,1306,1307],{},"Then keep the evidence in one place, next to the question each piece answers:",[1309,1310,1311,1324],"table",{},[1312,1313,1314],"thead",{},[1315,1316,1317,1321],"tr",{},[1318,1319,1320],"th",{},"Question",[1318,1322,1323],{},"Evidence",[1325,1326,1327,1336,1347,1355,1366,1374,1382],"tbody",{},[1315,1328,1329,1333],{},[1330,1331,1332],"td",{},"Is our data used to train models?",[1330,1334,1335],{},"The AWS quotes above, and the AWS Service Terms",[1315,1337,1338,1341],{},[1330,1339,1340],{},"Does AWS store it?",[1330,1342,1343,1344,1346],{},"Retention mode ",[138,1345,191],{}," in every Region, the SCP that locks it, and the alerts on changes",[1315,1348,1349,1352],{},[1330,1350,1351],{},"Does it cross the public internet?",[1330,1353,1354],{},"Route tables with no internet route, the VPC endpoint configuration, and a flow log sample",[1315,1356,1357,1360],{},[1330,1358,1359],{},"Where is it processed?",[1330,1361,1362,1363,1365],{},"The model IDs you call, the ",[138,1364,1115],{}," output, and the SCP that blocks global profiles",[1315,1367,1368,1371],{},[1330,1369,1370],{},"Who can use the model?",[1330,1372,1373],{},"The endpoint policies and the agent's IAM role",[1315,1375,1376,1379],{},[1330,1377,1378],{},"Is personal data minimized?",[1330,1380,1381],{},"The guardrail configuration, and the redaction in your tool code",[1315,1383,1384,1387],{},[1330,1385,1386],{},"What do we keep ourselves?",[1330,1388,1389],{},"The storage report from Step 5, with encryption and retention for each item",[14,1391,1392],{},"Kept up to date, that table answers every question with something checkable instead of a promise.",[14,1394,1395],{},[45,1396,939],{},[252,1398,1401],{"className":1399,"code":1400,"language":945,"meta":257},[943],"Add monitoring to our infrastructure code that proves our Bedrock setup stays\nprivate:\n\n1. Alert the security team (via our existing SNS topic or alerting channel)\n   on any CloudTrail event named PutAccountDataRetention, from Bedrock's\n   control plane or the Bedrock Mantle API. Check CloudTrail's documentation\n   for the exact event source names; don't guess them.\n2. Turn on VPC Flow Logs for the agent's subnets, delivered to an encrypted S3\n   bucket with a 90-day retention period.\n3. Add an AWS Config rule, or a scheduled check, that fails if any route\n   table attached to the agent's subnets has a 0.0.0.0/0 or ::/0 route.\n\nExplain how I can trigger each alert once in our sandbox account to confirm\nit works.\n",[138,1402,1400],{"__ignoreMap":257},[31,1404,1406],{"id":1405},"when-this-isnt-enough","When This Isn't Enough",[14,1408,1409],{},"Two situations need more than this setup. First, if the data legally can't leave your own premises, any cloud service is ruled out, and you're looking at self-hosted models on your own hardware. Second, if you need one of the models that requires retention, the question is whether AWS keeping data for up to 30 days, inside AWS, is acceptable to your legal team.",[14,1411,1412,1413,1417,1418,1422],{},"Some organizations can get zero-retention access to those models anyway. AWS evaluates it per account and per model through your AWS account team, and for some models, eligibility is managed by the model provider.",[50,1414,56],{"href":121,"rel":1415,"className":1416},[54],[56]," There's also an Enterprise Frontier Safeguards program that gives eligible customers zero retention for some of these models, but only until December 31, 2026.",[50,1419,56],{"href":81,"rel":1420,"className":1421},[54],[56]," After that, their traffic is retained again, so don't build a compliance case on it.",[31,1424,1426],{"id":1425},"the-checklist","The Checklist",[39,1428,1431,1443,1449,1458,1469,1475,1481,1487,1493,1499,1505],{"className":1429},[1430],"contains-task-list",[42,1432,1435,1439,1440,1442],{"className":1433},[1434],"task-list-item",[1436,1437],"input",{"disabled":307,"type":1438},"checkbox"," Retention is set to ",[138,1441,191],{}," in every Region you use, on both the Mantle and runtime endpoints.",[42,1444,1446,1448],{"className":1445},[1434],[1436,1447],{"disabled":307,"type":1438}," An SCP blocks any other retention mode, and no workloads run in the management account.",[42,1450,1452,1454,1455,1457],{"className":1451},[1434],[1436,1453],{"disabled":307,"type":1438}," Every model you use lists ",[138,1456,191],{}," in its allowed retention modes.",[42,1459,1461,1463,1464,1169,1466,1468],{"className":1460},[1434],[1436,1462],{"disabled":307,"type":1438}," The agent's subnets have no ",[138,1465,1300],{},[138,1467,1303],{}," route to an internet gateway, NAT or egress-only gateway.",[42,1470,1472,1474],{"className":1471},[1434],[1436,1473],{"disabled":307,"type":1438}," Bedrock is reached through VPC endpoints with private DNS, and the endpoint policies allow only the agent's role.",[42,1476,1478,1480],{"className":1477},[1434],[1436,1479],{"disabled":307,"type":1438}," Endpoints exist for every other AWS service the agent needs.",[42,1482,1484,1486],{"className":1483},[1434],[1436,1485],{"disabled":307,"type":1438}," Models run In-Region or through a geographic profile whose destination Regions you've checked and kept on file, and global profiles are blocked.",[42,1488,1490,1492],{"className":1489},[1434],[1436,1491],{"disabled":307,"type":1438}," A guardrail masks the personal data the model doesn't need, and your tool code redacts what the guardrail can't see.",[42,1494,1496,1498],{"className":1495},[1434],[1436,1497],{"disabled":307,"type":1438}," Invocation logs, app logs and vector stores are encrypted, access-controlled and have a retention limit.",[42,1500,1502,1504],{"className":1501},[1434],[1436,1503],{"disabled":307,"type":1438}," Retention changes trigger an alert, and VPC Flow Logs show no public traffic.",[42,1506,1508,1510],{"className":1507},[1434],[1436,1509],{"disabled":307,"type":1438}," The evidence table is filled in and up to date.",[31,1512,1514],{"id":1513},"conclusion","Conclusion",[14,1516,1517],{},"In a regulated industry, private AI on AWS isn't a different product. It's Bedrock with a handful of deliberate settings: retention off and locked, no route to the internet, processing kept where your data is allowed, personal data masked before the model sees it, and your own logs under control. Each one is a few lines of configuration or a single prompt to your coding agent, and together they give your security and compliance teams more than a vendor's promise: evidence they can check themselves.",[14,1519,1520,1521,112],{},"If you work in a regulated industry and want AI agents on AWS that your security and compliance teams will sign off on, ",[50,1522,1525],{"href":1523,"rel":1524},"https://www.linkedin.com/in/wassim-bougarfa/",[54],"message me on LinkedIn",[1527,1528,1529],"style",{},"html pre.shiki code .sIQBb, html code.shiki .sIQBb{--shiki-default:#BD93F9}html pre.shiki code .s0Tla, html code.shiki .s0Tla{--shiki-default:#FF79C6}html pre.shiki code .seVfx, html code.shiki .seVfx{--shiki-default:#E9F284}html pre.shiki code .s-mGx, html code.shiki .s-mGx{--shiki-default:#F1FA8C}html pre.shiki code .shSDL, html code.shiki .shSDL{--shiki-default:#6272A4}html pre.shiki code .sAOxA, html code.shiki .sAOxA{--shiki-default:#50FA7B}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sCdxs, html code.shiki .sCdxs{--shiki-default:#F8F8F2}html pre.shiki code .sY8FZ, html code.shiki .sY8FZ{--shiki-default:#8BE9FE}html pre.shiki code .sLL85, html code.shiki .sLL85{--shiki-default:#8BE9FD}",{"title":257,"searchDepth":304,"depth":304,"links":1531},[1532,1533,1534,1535,1536,1537,1538,1539,1540,1541,1542,1543,1544],{"id":33,"depth":304,"text":34},{"id":100,"depth":304,"text":101},{"id":156,"depth":304,"text":157},{"id":220,"depth":304,"text":221},{"id":238,"depth":304,"text":239},{"id":950,"depth":304,"text":951},{"id":1056,"depth":304,"text":1057},{"id":1153,"depth":304,"text":1154},{"id":1212,"depth":304,"text":1213},{"id":1274,"depth":304,"text":1275},{"id":1405,"depth":304,"text":1406},{"id":1425,"depth":304,"text":1426},{"id":1513,"depth":304,"text":1514},"How regulated companies can run AI agents on Amazon Bedrock with zero data retention, no training on their data, no public internet, and proof for their auditors.","md",{"cover":167,"author":1548,"date":1550,"isDraft":1551,"image":167,"imageAlt":1552,"layout":1553,"tags":1554},{"name":1549},"Wassim Bougarfa","2026-10-11",false,"A private Amazon Bedrock setup for AI agents in regulated industries","article",[1555,1556,1557,1558,1559,1560,1561],"aws","bedrock","ai-agents","privatelink","compliance","security","architecture",null,"/blogs/private-ai-on-bedrock",{"title":5,"description":1545},{"loc":1563,"lastmod":1550,"changefreq":1566,"priority":1567},"monthly",0.8,"blogs/3.private-ai-on-bedrock","gXOXWzPD-wWYC3iLB-_ziEbL7edb0UL4uxdbez1p3vg",1795893496187]