Skip to lesson

AWSAWS Certified Generative AI Developer - Professional2026-103.4 Implement responsible AI principles

Enforce approved use through explicit policy gates

Completed by the knowledge check

Learning objective

Enforce responsible AI policies using Bedrock Guardrails, model cards, and Lambda compliance checks.

Core idea

Responsible AI policy becomes enforceable when a request reaches a gate that can actually prevent an unauthorized use or unsafe release. Documentation, content assessment, and application compliance logic play different roles. Combine them without assuming that any one mechanism understands the entire policy.

Use a model card to record approved context and supporting evidence. Use Bedrock Guardrails for the configured content checks. Use application-owned Lambda logic for deterministic requirements such as eligible use, approved configuration, and required review. Define what happens when a check intervenes, fails, or lacks enough evidence.

For an architect, the critical decision is who owns each rule and which result permits processing to continue. A generic statement that “the solution uses responsible AI services” does not specify an enforceable boundary.

How it works

Translate policy into separate gates

Start with an approved requirement, such as “this assistant provides general policy guidance but does not make final coverage decisions.” Break it into observable conditions. The request must target an approved task, use an approved model/prompt/policy release, and avoid releasing content prohibited by the configured policy. A consequential decision might also require human approval.

Map each condition to the mechanism that can evaluate it. Do not ask a content filter to determine an employee’s entitlement, or ask a model card to stop an API call. Authorization remains an application and AWS policy concern as described in 3.2.2. The responsible-use gate adds constraints on what an otherwise authorized request is permitted to accomplish.

Record the rule version with the decision so later reviews can explain why a request was accepted or withheld. Approval of one use case should not silently authorize every application using the same model.

Use model cards as approval evidence

SageMaker AI model cards document intended uses, risk ratings, training details, evaluation results, and limitations. Their intended-use section should cover suitable and unsuitable scenarios. Lesson 3.3.2 explains the card’s governance role; this lesson focuses on connecting that record to enforcement.

DescribeModelCard accepts ModelCardName and an optional ModelCardVersion, and returns Content, ModelCardStatus, and version information. An application can use a reviewed card version as evidence for a release gate. Pin the approved version or retain an approved release mapping, rather than interpreting any available card as permission to use the model.

The returned status values include Draft, PendingReview, Approved, and Archived. These describe the card’s status. They do not create a runtime authorization policy for Bedrock or prove that the present request fits the intended use. Application logic must compare the approved release and requested purpose with the organization’s policy.

Avoid treating prose in a card as executable rules. Extract reviewed conditions into a deterministic, versioned policy configuration with accountable ownership. Keep the card as the explanation and evidence for those conditions. If the executable rule and the card disagree, withhold the affected release until the owner resolves the inconsistency.

Apply content checks and interpret intervention

ApplyGuardrail evaluates supplied content using guardrailIdentifier, guardrailVersion, source, and content. source distinguishes INPUT from OUTPUT. Its response includes action, assessments, and outputs; documented action values are NONE and GUARDRAIL_INTERVENED.

Use an approved guardrail version for the release and test its behavior before deployment. An IAM policy using the bedrock:GuardrailIdentifier condition key can deny inference requests that omit the required guardrail or use a different version-qualified guardrail ARN. AWS documents enforcement for Converse, ConverseStream, InvokeModel, and InvokeModelWithResponseStream; see 3.3.1 for policy design. Specific policy families and enforcement paths are covered in 3.1.1 and 3.1.2. Here, the important point is how the application joins the result to the responsible-use decision. NONE means the guardrail did not intervene on that assessment; it does not certify fairness, business compliance, or truth.

An intervention can reflect blocking or transformation such as sensitive-information masking. Inspect the applicable assessment and the permitted output contract instead of assuming every intervention means the same response. Never release the original unreviewed text after accepting a transformed output.

Distinguish an assessment error from NONE. An unavailable check is not a successful content assessment. For a release requiring that check, withhold the answer or use an approved fallback whose requirements are satisfied. Streaming release design belongs to 3.1.2; the same gate must protect content before it becomes visible.

Make Lambda checks authoritative

A Lambda compliance check is your code, not a built-in policy-certification feature. Define a typed result with an application-owned decision such as accept, deny, or review, plus rule identifiers and safe reason codes. Validate the requested purpose and resolved release identifiers against trusted policy data before generation or tool execution.

For a synchronous check, Invoke with InvocationType: RequestResponse returns the function’s response. AWS states that the API status code does not reflect function errors; inspect FunctionError and the response payload. A successful transport response alone must never grant permission to continue.

InvocationType: Event acknowledges asynchronous invocation without returning the compliance decision. It cannot serve as a synchronous prerequisite to releasing the same request. If the workflow requires asynchronous review, retain the request as pending and wait for explicit completion evidence.

Make failure behavior part of the contract. A timeout, malformed payload, unknown rule version, or missing approval must have a defined outcome. Do not let an exception path bypass a gate that the normal path requires. Retain a sanitized decision record for audit without copying sensitive prompts into every log; see 3.2.9.

Key distinctions and trade-offs

Documentation versus enforcement: A model card explains suitability and approval evidence. Lambda or another application gate enforces the reviewed conditions.

Content assessment versus compliance: Guardrails assess configured content policies. The application decides whether the request fits approved use, release configuration, and review requirements.

Invocation success versus policy acceptance: Lambda transport success is not a passing compliance result. Inspect execution errors and the explicit decision payload.

Synchronous checks add work to the request path but provide a decision before release. Asynchronous review supports longer investigations but needs a pending state. Choose the path from the decision’s consequences rather than treating latency reduction as permission to omit the gate.

Architecture / decision scenario

A benefits assistant is approved for general guidance, while final coverage decisions require a reviewer. Its model card records that limitation and the supporting evaluations.

A pre-generation Lambda check verifies the approved card/release mapping and classifies the requested operation under deterministic policy rules. General guidance can proceed; a final coverage request becomes pending review. Guardrails assess the permitted input and proposed output with the pinned policy version.

If Guardrails masks sensitive content, the response uses the accepted transformed output. If the Lambda invocation returns FunctionError or Guardrails cannot complete, the application withholds release and records the failed gate. An approved card and a fluent answer do not override either failure. The reviewer receives sufficient authorized evidence to decide the pending case.

Release follows only an explicit accept from the Lambda check and a completed Guardrails assessment.

Release follows only an explicit accept from the Lambda check and a completed Guardrails assessmentStarts at a request, which the pre-generation Lambda compliance check classifies. Review makes it pending review; deny or a FunctionError withholds release. An accepted request reaches the Guardrails assessment of input and proposed output: NONE releases, masking releases the accepted transformed output, and blocking or an unavailable check withholds release.reviewacceptdeny or FunctionErrorNONEmasksblocks or check unavailableRequestLambda compliancecheckPending reviewGuardrails assessinput and proposedoutputAcceptedtransformed outputReleaseWithhold release

Common exam traps

  • Treating an approved model card as automatic runtime authorization.
  • Assuming action: NONE means complete responsible AI compliance.
  • Returning original text after a guardrail transforms it.
  • Accepting Lambda HTTP success without checking its decision and FunctionError.
  • Using asynchronous invocation as proof that a pre-release check passed.
  • Allowing missing approval or assessment errors to bypass policy gates.

What to remember

  • Assign each requirement to an enforceable gate and an accountable owner.
  • Pin model-card evidence and release-policy mappings.
  • Interpret Guardrails intervention under the accepted output contract.
  • Treat Lambda compliance decisions as explicit application results.
  • Withhold release when a required gate fails or lacks evidence.

Knowledge check

References