Technical Guide

    Where to Enforce Policy When Amazon Bedrock Knowledge Bases Calls the Model for You

    In a managed RetrieveAndGenerate flow, the application can enforce policy before the request and on the returned response, and through the service's own configuration. It cannot intercept the prompt the service assembles from retrieved chunks. If policy must act on retrieved context or the prompt itself, use a Retrieve-then-generate pattern, where the application issues the model call through an enforcement point and records each decision.

    Criteria for choosing a pattern

    • Must policy act on retrieved chunks or the assembled prompt, or are request and response checks enough?
    • Do you need to redact or drop individual pieces of context, rather than block the whole interaction?
    • Do you need one evidence record per interaction that links query, context and output?
    • Can the application team own orchestration, retries and enforcement point availability?
    • Can you guarantee that no code path calls the model without passing the enforcement point?
    • Do agent or tool-call actions follow retrieval, and do they need the same policy applied?

    Why the managed flow changes the enforcement question

    In a conventional retrieval-augmented application, your code retrieves context, builds a prompt and calls the model. Every one of those steps is a place where you can inspect, change or stop the interaction. When a managed service such as Amazon Bedrock Knowledge Bases orchestrates retrieval and invokes the foundation model on the caller's behalf, as it does through RetrieveAndGenerate, the application no longer makes a direct model call that it can intercept.

    That does not mean policy cannot be enforced. It means enforcement has to be placed deliberately, and each placement has a different view of the interaction. A control can only act on what passes through it. A check at the application boundary sees the user's request. It does not see the chunks retrieved on the request's behalf or the prompt built from them, unless the application takes those steps back.

    For regulated enterprises the practical questions are which controls are actually in the execution path, what each can see, whether it can allow, redact or block, and what evidence it leaves behind for each interaction.

    The enforcement points compared

    The table summarizes what each placement can observe, which actions it supports and what evidence it can produce. Native AWS controls belong in this picture as complements. Identity, network and service-side configuration each answer a different question than content-level enforcement does.

    • Application boundary, before the request: Sees: the user's request, identity and session context. Can: allow, redact, block, rate limit or escalate before anything leaves the application. Cannot see: retrieved chunks or the assembled prompt. Evidence: a decision record per request.
    • Between Retrieve and the model call: Sees: the query, retrieved chunks and the final prompt. Can: allow, redact or drop context, block, escalate. Requires the application to issue the model call. Evidence: context and decision per interaction.
    • Managed-service configuration: Acts inside the service on configured controls. Visibility and actions are bounded by what the service exposes. Evidence comes from service-side records rather than from your enforcement point.
    • Returned response: Sees: the output as delivered. Can: redact or block before display or before a downstream tool acts. Cannot see: the prompt as assembled. Evidence: output decision per interaction.
    • Identity and network controls: Decide who and what can reach the service and by which path. They are access controls, not content inspection, so they do not evaluate prompts, context or outputs.

    Managed RetrieveAndGenerate versus Retrieve-then-generate

    The two patterns differ mainly in who makes the model call. In the managed flow, one request returns a generated answer, and the intermediate steps happen inside the service. The application gains simplicity and gives up interception of the middle of the flow. Your policy then rests on the request check, the response check and the service's configuration.

    In a Retrieve-then-generate pattern, the application asks only for retrieval, receives the chunks, and then issues the model call itself through an enforcement point. That adds the position between retrieval and generation, where retrieved content can be inspected before it influences the model. The cost is operational. The application now owns prompt assembly, model invocation, error handling and the availability of the enforcement point, and it has to make sure no code path bypasses that point.

    • Visibility of retrieved context: Managed: inside the service, not interceptable by the application. Retrieve-then-generate: fully visible to the application and the enforcement point.
    • Visibility of the assembled prompt: Managed: not interceptable. Retrieve-then-generate: the application builds it, so it can be inspected and changed before the call.
    • Available actions: Managed: request and response actions, plus service configuration. Retrieve-then-generate: allow, redact, block, rate limit or escalate at any step the application controls.
    • Operational burden: Managed: lower. Retrieve-then-generate: the application owns orchestration, and the enforcement point must be kept in the path.
    • Evidence per interaction: Managed: request and response decisions plus service-side records. Retrieve-then-generate: a record that spans query, context, prompt and output.

    How runtime enforcement becomes audit evidence

    Evidence is a by-product of where enforcement happens. A control that makes a decision on an individual interaction can record what it saw, what policy applied and what it did. A control that only reviews activity afterward can describe what occurred, but it cannot show that a rule was applied before the output was released.

    This matters because retrieval is increasingly named in compliance language. A General Services Administration acquisition clause text published in a Federal Register document dated June 2026 applies when Government Data is processed by a large language model. It defines background data to include reference materials and knowledge bases retrieved through mechanisms such as retrieval processes, vector stores, embeddings, tool calls and agent actions. It also calls for defense in depth through access controls, policy enforcement points, labeling and encryption, with continuous monitoring. Its final status and effective date are not stated in the text reviewed, so as of November 2026 treat it as a signal of how retrieval may be scoped, not as a settled obligation.

    The design lesson is that layered enforcement is more defensible than a single control, and that controls should cover retrieved context and tool calls as well as the user prompt. If retrieved context is in scope for your obligations, the managed flow's inability to expose it to your own enforcement point is a requirement to weigh, not a detail.

    Where Trussed fits

    Trussed applies to the Retrieve-then-generate pattern. When the application issues the model call, Trussed sits in the execution path and enforces policy at runtime, not reviewed after the fact. It can allow, redact, block, rate limit or escalate an interaction for human approval, and its scope is individual interactions and tool calls. Each enforcement decision generates audit-ready evidence, mapped to frameworks including HIPAA, NAIC, NYDFS, the EU AI Act and NIST.

    Trussed deploys self-managed in the customer's cloud, with configurable retention and data residency. It has run continuously in production at a regulated enterprise for more than 18 months, with 99.95% uptime on live production traffic. It does not replace native AWS controls. It adds an enforcement point where the managed flow offers none to the application.

    Enforcement points in a knowledge-base request flow

    1. Application boundary

    Acts on the incoming request before it reaches retrieval.

    2. Between Retrieve and generate

    Acts on retrieved context and the prompt. Available only when the application issues the model call.

    3. Managed-service configuration

    Controls applied inside the service, outside the application's line of sight.

    4. Returned response

    Acts on the output before it reaches the user or a downstream tool.

    See what enforcement evidence looks like per interaction

    Walk through a Retrieve-then-generate flow with an enforcement point in the path and review the evidence each decision produces.

    See How Evidence Is Produced
    Next step

    How does your AI governance program compare?

    See where your program has gaps in less than 2 minutes.