Building Secure Generative AI Applications at Scale: Amazon's Journey from Experimental to Production
amazon · E-commerce · 2025 · source Agentic: no · promotional bias: med · source-backed · extracted with prompt 0.5.5 (schema v2)
Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.
Problem
Domain: Enterprise generative AI security operations
Amazon needed to move generative AI applications from experimentation to production while handling nondeterministic model behavior, new attack vectors, fast-changing security techniques, and a large builder population deploying customer-facing and internal AI systems.
Constraints:
- Foundation-model behavior is complex and less interpretable than traditional application code.
- Security must cover code, model-training data, prompts, model outputs, agents, and downstream tool calls.
- Prompt injection cannot be fixed once in code the way traditional SQL injection often can.
- Guardrails must operate on both user inputs and model responses and remain updateable after launch.
- Security tooling must fit existing builder pipelines rather than require constant manual security-team intervention.
- New attack patterns emerge frequently, so test baselines and golden paths must keep changing.
Architecture
Amazon's production GenAI security architecture combines secure-by-default building blocks with continuous testing and operations. Builders use Bedrock, Bedrock Guardrails, data perimeters, permissions, APIs, agents, and golden-path templates to launch common GenAI patterns. Existing AppSec, pentest, bug bounty, incident-response, and policy mechanisms are augmented with GenAI-specific threat modeling, prompt testing, and guardrail questions. FAST, the Framework for AI Security Testing, integrates with build pipelines and pre-prod stages: it loads a maintained baseline of attack prompts, calls the app through a proxy lambda against the user interface or inference endpoint, uses AI classifiers to detect deflection/errors/PII/out-of-bound responses, generates scorecards, and can block deployment until owners fix guardrails, prompts, or mitigations.
Diagram confidence: explicit (topology described by the source).
flowchart LR builder-source-repository[Builder source repository] --> build-system[Build system] builder-source-repository --> golden-path-templates[Golden path templates] golden-path-templates --> bedrock-platform[Bedrock platform] golden-path-templates --> runtime-guardrails[Runtime guardrails] bedrock-platform --> runtime-guardrails bedrock-platform --> inference-endpoint[Inference endpoint] threat-model[Threat model] --> security-mechanisms[Security mechanisms] threat-model --> fast-baseline-prompt-suite[FAST baseline prompt suite] security-mechanisms --> golden-path-templates security-mechanisms --> operating-flywheel[Operating flywheel] build-system --> pre-prod-stage[Pre prod stage] pre-prod-stage --> fast-runner[FAST runner] fast-baseline-prompt-suite --> fast-runner fast-runner --> proxy-lambda[Proxy lambda] proxy-lambda --> user-endpoint[User endpoint] proxy-lambda --> inference-endpoint user-endpoint --> runtime-guardrails inference-endpoint --> runtime-guardrails fast-runner --> ai-response-classifiers[AI response classifiers] ai-response-classifiers --> security-scorecard[Security scorecard] fast-runner --> security-scorecard security-scorecard --> pre-prod-stage security-scorecard --> builder-remediation-loop[Builder remediation loop] builder-remediation-loop --> runtime-guardrails builder-remediation-loop --> pre-prod-stage pre-prod-stage --> production-deployment[Production deployment] production-deployment --> operating-flywheel operating-flywheel --> runtime-guardrails
Components
| Component | Role | Interacts with |
|---|---|---|
Builder source repository |
Application source code and GenAI configuration owned by product teams. | Build system, Golden path templates |
Golden path templates |
Secure-by-default application templates and pluggable components for common and specialized GenAI workloads. | Builder source repository, Bedrock platform, Runtime guardrails |
Bedrock platform |
AWS platform for selecting, optimizing, fine-tuning, customizing, and connecting models and agents. | Golden path templates, Runtime guardrails, Inference endpoint |
Runtime guardrails |
Input/output controls, content filters, topic filters, PII removal, data perimeters, and network/data consistency controls. | Bedrock platform, User endpoint, Inference endpoint, Operating flywheel |
Threat model |
GenAI security model that classifies frontend prompt injection and backend agent/indirect-prompt threats. | Security mechanisms, FAST baseline prompt suite |
Security mechanisms |
Augmented AppSec reviews, pentesting, bug bounty, incident response, policies, and guidance pages. | Threat model, Golden path templates, Operating flywheel |
Build system |
Existing builder CI/CD flow that runs integration tests and deploys to pre-prod before production. | Builder source repository, Pre prod stage |
Pre prod stage |
Pipeline phase where approval workflows and FAST security tests gate promotion to production. | Build system, FAST runner, Production deployment |
FAST runner |
Framework for AI Security Testing that runs baseline attack prompts and evaluates generated outputs. | Pre prod stage, FAST baseline prompt suite, Proxy lambda, AI response classifiers, Security scorecard |
FAST baseline prompt suite |
Maintained default prompt set updated from bug bounty, pentest, findings, and new attack patterns. | Threat model, FAST runner |
Proxy lambda |
Adapter used by FAST to invoke the application endpoint with test prompts. | FAST runner, User endpoint, Inference endpoint |
User endpoint |
Frontend/user-facing application interface for customer-style prompt testing. | Proxy lambda, Runtime guardrails |
Inference endpoint |
Backend model endpoint or data-processing path tested when no user interface exists. | Proxy lambda, Bedrock platform, Runtime guardrails |
AI response classifiers |
AI evaluators that classify deflections, errors, PII disclosures, and out-of-bound responses. | FAST runner, Security scorecard |
Security scorecard |
Application-specific results showing how the app performed against FAST tests. | AI response classifiers, Pre prod stage, Builder remediation loop |
Builder remediation loop |
Self-service process where owners inspect failures, update guardrails/system prompts/mitigations, and rerun the pipeline. | Security scorecard, Runtime guardrails, Pre prod stage |
Production deployment |
Released GenAI application such as Rufus or an internal Amazon Q assistant. | Pre prod stage, Operating flywheel |
Operating flywheel |
Post-launch loop that monitors responses, finds defects, adapts controls, and updates guardrails. | Production deployment, Runtime guardrails, Security mechanisms |
Data flow
A product team starts from golden-path templates or Bedrock components, selects and customizes a model, adds runtime guardrails, and builds a GenAI app. Existing security mechanisms apply a GenAI threat model and prompt-testing expectations. When code changes enter the build system, the pre-prod stage invokes FAST. FAST loads the default baseline prompts, sends them through a proxy lambda to the user interface or inference endpoint, evaluates the outputs with AI classifiers for deflection, errors, PII, and out-of-bound behavior, and produces a security scorecard. If the app fails, the pipeline can block; the builder updates guardrails, prompts, or mitigations and reruns. After production launch, monitoring and feedback feed an operating flywheel that updates guardrails and test baselines as new attacks or defects appear.
7 supporting quotes
Why this architecture
Amazon built security into existing development mechanisms because GenAI risk changes too quickly for one-time review or manual security-team intervention. Nondeterministic outputs, prompt injection, context-window attacks, PII leakage, and agent/tool behavior require continuous testing of inputs and outputs. Golden paths reduce duplicated security work for builders, while FAST scales security review across many apps by running new attack baselines in the same pipelines builders already use.
5 supporting quotes
Models used: Foundation models available through Amazon Bedrock · Amazon Q Business · Amazon Q Developer · Rufus shopping assistant models · Amazon Nova models · AI classifiers used by FAST
Scale
- Amazon describes the shift from experimentation in 2023 to production applications in late 2023 and 2024.“things started trickling into production towards the end of 2023, 2024”transcript, stated
- By 2025, Amazon had a year of production GenAI applications deployed.“we came to 2025, there's been a year with production applications deployed out there”transcript, stated
- The talk names multiple production applications: Amazon Q Business, Q Developer, and Rufus.“we released Amazon Q Business, we released Q Developer, we released, within the Amazon space, Rufus”transcript, stated
- The security team expects meaningful GenAI changes roughly every couple of weeks.“almost every couple of weeks, there's a new technique or a new thing that comes out.”transcript, stated
- FAST maintains an evolving baseline from bug bounty, pentesting, and findings across all products.“as we learn any new attack in this space from bug bounty to pentest to any of our findings, we'll iterate the baseline that we test everything against.”transcript, stated
- Amazon emphasizes fitting security tools to a very large builder population.“our builder population, which, at Amazon, is a very large population.”transcript, stated
Alternatives considered (roads not taken)
Treat GenAI security like traditional static code security
Rejected because: Foundation models are complex, nondeterministic, and data-centric, so flaws can live in prompts, data, outputs, or model/tool behavior.
Fix prompt injection like SQL injection
Rejected because: Prompt injection involves nondeterministic interaction between user input and model behavior, so there is no single code fix.
Build completely separate AI security processes
Rejected because: Amazon already had AppSec, pentest, bug bounty, incident response, and builder CI/CD mechanisms that could be augmented for GenAI.
Require every builder to hand-assemble security controls
Rejected because: Security requirements span many teams, policies, datasets, and controls, so duplicated manual implementation would not scale.
Human-review every FAST output
Rejected because: The volume of prompts and outputs is too high, so Amazon uses AI classifiers to score responses.
Patterns
guardrails-io-filtering (security)
Amazon uses Bedrock Guardrails and runtime controls for harmful content thresholds, topic filtering, PII removal, blocked words, and input/output guardrails.
eval-driven-development (quality)
Amazon treats GenAI security as a cycle of testing, evaluating, fine-tuning, implementing guardrails, reevaluating, releasing, and monitoring.
observability-tracing (operations)
Post-launch operation monitors responses, defects, user feedback, and where guardrails need adaptation.
safety-policy-enforcement (security)
Amazon translates responsible AI principles, security policies, threat models, and existing AppSec/pentest/bug-bounty mechanisms into enforceable GenAI release checks.
canary-rollout (release)
FAST gates pre-prod pipeline promotion, blocking production movement when AI security tests fail.
fallback-degradation (operations)
Guardrail versioning, rollback agility, and patching speed let teams decide whether to fix forward or roll back when defects appear.
model-routing (architecture)
Bedrock lets builders choose and optimize models by use-case needs such as cost, latency, and accuracy.
Tradeoffs
Augment existing security mechanisms
Chose AppSec, pentest, bug bounty, incident response, and guidance updates over A separate AI-only security organization and process.
Rationale: Existing mechanisms already scale across Amazon; adding GenAI-specific questions and training preserves builder familiarity while expanding coverage.
Use golden paths for secure-by-default development
Chose Common linear templates plus pluggable pink-box components over Every team inventing its own secure GenAI architecture.
Rationale: Templates accelerate builders while giving specialized teams flexible components for prompt engineering, evaluation, and model comparison.
Make FAST modular by integration point
Chose Test either user interface or inference endpoint over A single mandatory testing surface.
Rationale: Some GenAI workloads are user-facing, while backend data pipelines may be better tested at the inference endpoint.
Use AI classifiers for FAST scoring
Chose Automated response classification over Manual review of every test output.
Rationale: The number of prompts and outputs is too large for humans to review at Amazon scale.
Default to pipeline blocking on security test failures
Chose FAST can block promotion until owners remediate over Advisory-only AI security reporting.
Rationale: Blocking ensures critical findings are addressed before production, while remediation remains self-service for builders.
Gotchas (what bit them)
Prompt injection lacks a single code-level fix.
Root cause: The attack is an unsafe interaction between user input and a nondeterministic model, not a deterministic query construction bug.
Resolution: Continuously test inputs and outputs, evaluate behavior, tune data/prompts, and add external validation and guardrails.
Security reviews missed GenAI-specific failure questions until augmented.
Root cause: Existing mechanisms did not naturally ask about hallucinations, wrong product summaries, or prompt-level failures.
Resolution: Add GenAI questions to AppSec reviews, pentesting, bug bounty, incident response, policies, and guidance pages.
Internal assistants have different risk semantics than customer-facing retail assistants.
Root cause: Wrong internal knowledge such as a holiday schedule can directly change employee decisions.
Resolution: Adapt guardrails and threat thinking to internal context, access-control gaps, and employee impact.
Enhanced discovery can reveal access-control gaps.
Root cause: Internal chatbots make company documents easier to find, including resources that may have been too broadly shared.
Resolution: Use discovery behavior to identify and remediate access-control issues.
Guardrails are not one-and-done controls.
Root cause: New attacks, bad customer experiences, hallucinations, and product defects appear after launch.
Resolution: Operate a flywheel that monitors, evaluates, adapts controls, and updates guardrails.
FAST can surface hallucinated or real PII in model responses.
Root cause: A malicious prompt can cause an app to emit personal-looking data, and the system must detect whether PII appears in outputs.
Resolution: Use classifiers to flag unsanitized PII and redact phone numbers in logs.
Evaluation
Amazon evaluates GenAI applications through prompt testing, pre-prod FAST runs, maintained baseline attack prompts, AI classifiers for deflection/errors/PII/out-of-bound behavior, scorecards, pipeline gates, AppSec/pentest/bug-bounty augmentation, and post-launch monitoring/guardrail adaptation.
Metrics: Deflection classification · Error classification · PII disclosure classification · Out-of-bound response classification · FAST security scorecard · Pipeline pass/fail · Guardrail version and last-known-bug coverage · Production defects and customer experience flaws
5 supporting quotes
Outcomes
- Amazon moved from 2023 experimentation to deployed production GenAI applications including Amazon Q Business, Q Developer, and Rufus.
- Rufus taught the security team to build agility, continuous refinement, rollback, and guardrail iteration into GenAI security operations.
- The internal Amazon Q assistant improved employee discovery of company resources while revealing access-control gaps.
- FAST gives Amazon a reusable, pipeline-integrated way to test GenAI applications against evolving attack baselines.
- Golden paths and augmented security mechanisms help Amazon scale AI security across a large builder population.
The system is designed for Amazon-scale builder adoption: production GenAI apps had been live for a year by 2025, new GenAI techniques appear every couple of weeks, and FAST reruns a maintained baseline every time participating teams change code.