Amazon Bedrock Guardrailsで年齢対応・文脈認識AIを構築
AWSはAmazon Bedrock Guardrailsを用いたサーバーレスなガードレールファーストのソリューションを発表し、ユーザーの年齢や役割に応じてAI応答を適応させ、安全ポリシーを集中管理することで、責任あるAIシステムの導入を支援する。
キーポイント
ユーザーコンテキストに基づく動的ガードレール選択
ユーザーの年齢、役割、業界知識に応じてAIの応答を適応的に調整し、子供、ティーン、医療専門家、患者、一般成人の5つのユーザーセグメント向けに特化したガードレールを提供する。
Amazon Bedrock Guardrailsによる集中ポリシー適用
推論時に安全ポリシーを適用することで、プロンプト操作によるバイパスを防止し、複数のAIアプリケーション間で一貫したガバナンスを実現する。
サーバーレスアーキテクチャによる効率的な運用
複雑なアプリケーションコードを最小限に抑え、集中化されたガバナンスと最小限の手動介入で運用効率を向上させ、ユーザー成長や安全要件の進化に合わせてスケールする。
脆弱な人口に対するコンプライアンス要件への対応
教育や医療などの敏感な領域で動作するAIシステムが脆弱なユーザーと相互作用する際の、安全でないコンテンツや不適切な応答のリスクを軽減する。
影響分析・編集コメントを表示
影響分析
この記事は、生成AIの実運用における最大の課題の一つである「ユーザー適応型の安全性確保」に対して、AWSが実践的なソリューションを提供したことを示している。特に教育・医療などの敏感な領域でのAI導入を加速させると同時に、業界全体の責任あるAI実装の基準を引き上げる可能性がある。
編集コメント
AWSが生成AIの実運用における核心課題に正面から取り組む姿勢が明確に示された記事。技術的な革新性よりも、実践的な運用フレームワークとしての価値が高い内容となっている。
生成 AI アプリケーションを多様なユーザーグループに展開する際、各 AI の回答が特定のユーザーにとって適切で正確かつ安全であることを検証するという、ユーザーの安全性やアプリケーションの信頼性に大きな影響を与える課題に直面することがあります。成人向けに適したコンテンツは子供にとっては不適切または混乱を招くものとなり、初心者向けの説明はドメインの専門家には不十分になる可能性があります。業界全体での AI 導入が加速する中、回答をユーザーの年齢、役割、およびドメイン知識に合わせて調整する必要が生産環境への展開において不可欠となっています。
この課題に対処するために、プロンプトエンジニアリングやアプリケーションレベルのロジックを試みることがあります。しかし、これらのアプローチは重大な課題を生じさせる可能性があります。プロンプトベースの安全制御は、モデルを欺いて安全指示を無視させるような操作手法によって回避されてしまうことがあります。パーソナライゼーション要件が増大するにつれてアプリケーションコードは複雑で脆弱なものとなり、異なる AI アプリケーション間でガバナンスが不整合になる恐れがあります。さらに、AI システムが脆弱なユーザーと対話したり、教育や医療といった敏感なドメインで動作したりする場合、不安全なコンテンツ、幻覚情報、不適切な回答のリスクが増幅されます。中央集権的で強制可能な安全ポリシーが存在しないことは、運用上の非効率性とコンプライアンスリスクを生み出します。
これらの課題に対処するため、Amazon Bedrock Guardrails および現代的な AI セーフティとコンプライアンスの要件に合致するその他の AWS サービスを活用し、サーバーレスでガードレールファーストなソリューションを実装しました。このアーキテクチャは、主に 3 つのコンポーネントを提供します:ユーザーの文脈に基づく動的なガードレールの選択、Amazon Bedrock Guardrails を通じた集中型ポリシーの適用、認証アクセスのためのより安全な API です。このサーバーレス設計を活用することで、複雑なアプリケーションコードを必要とせず、パーソナライズされ安全な AI 応答を、より効率的かつ安全に、かつスケーラブルに提供することができます。
本稿では、AWS のサーバーレスアーキテクチャを用いて、完全に自動化された文脈認識型 AI ソリューションを実装する方法について解説します。具体的には、以下のような機能を備えたスケーラブルなシステムの設計とデプロイ方法を示します:
- ユーザーの年齢、役割、業界に基づいて AI の応答を知的に適応させる
- プロンプト操作による回避を防ぐために推論時に安全ポリシーを強制する
- 子供、ティーンエイジャー、医療従事者、患者、一般成人という異なるユーザーセグメント向けに 5 つの専門的なガードレールを提供する
- 集中型ガバナンスと最小限の手動介入により運用効率を向上させる
- ユーザー数の増加や進化していく安全要件に合わせてスケーラブルに対応する
このソリューションは、責任ある AI システムの導入を検討している組織、脆弱な人口集団に対するコンプライアンス要件への適合、およびパフォーマンスやガバナンスを損なうことなく多様なユーザーグループ全体で適切で信頼性の高い AI 応答を維持したい組織にとって役立ちます。
ソリューションの概要
このソリューションは、インテリジェントな応答生成、集中型ポリシー適用、およびセキュアなアクセスを実現するためのコアサービスとして Amazon Bedrock、Amazon Bedrock Guardrails、AWS Lambda、および Amazon API Gateway を使用しています。Amazon Cognito、Amazon DynamoDB、AWS WAF、および Amazon CloudWatch などのサポートコンポーネントは、ユーザー認証、プロファイル管理、セキュリティ、包括的なログ記録を可能にするために活用されています。
このアプローチの独自性は、動的ガードレール選択機能にあります。Amazon Bedrock と Bedrock Guardrails は、認証されたユーザーのコンテキスト(年齢、役割、業界)に基づいて自動的に適応し、推論時に適切なセキュリティポリシーを適用するよう支援します。この「ガードレールファースト」のアプローチは、プロンプトベースの安全対策と併用され、多層防御を提供します。具体的には、5 つの専門化されたガードレールが用意されています:児童保護(Children's Online Privacy Protection Act または COPPA 準拠)、ティーンエイジャー教育用、医療従事者用、医療患者用、および成人一般用です。これらのガードレールは、アプリケーションロジックとは独立して動作し、AI モデルが何を発言できるかを規定する権威あるポリシー適用層として機能します。
このソリューションはサーバーレスのスケーラビリティを活用し、セキュリティポリシーを強制するとともに、ユーザーのコンテキストに基づいて応答を適応させるため、多様なユーザー層を対象とするエンタープライズ AI 展開に最適です。本ソリューションは Terraform を用いてデプロイ可能であり、インフラストラクチャおよびアプリケーションコンポーネントの反復可能なエンドツーエンド自動化を実現します。
図1に示すように、Web UI はテストおよびデモンストレーション用のローカルデモサーバー(localhost:8080)として実行されます。本番環境での展開においては、組織はAPIエンドポイントを既存のWebアプリケーションと統合するか、Amazon Simple Storage Service (Amazon S3) にAmazon CloudFront またはAWS Amplify を用いてインターフェースをデプロイすることができます。

*図1:サーバーレス *年齢対応型・文脈認識型 AI Bedrock アーキテクチャ*
多文脈AIセーフティ戦略
アーキテクチャコンポーネントについて理解したところで、本ソリューションが異なるユーザーの文脈に基づいてどのように動的に応答を適応させるかを見ていきましょう。以下の図(図2:Amazon Bedrock Guardrails を用いた年齢対応型・文脈認識型 AI のワークフロー)は、異なるユーザープロファイルがどのように処理されるかを示しています:
image** 図 2: *年齢対応型・文脈認識 AI の Amazon Bedrock Guardrails ワークフロー* *
ソリューションの仕組み
本ソリューションのワークフローには、以下のステップが含まれます(図 1:Amazon Bedrock Guardrails を用いた年齢対応型・文脈認識 AI のソリューションアーキテクチャを参照):
- ユーザーリクエストと Web インターフェース
Web インターフェース:ユーザーはローカルのデモ用 Web インターフェースにアクセスします(デモンストレーション目的で localhost:8080 で実行されます)
- ユーザー入力:ユーザーは Web インターフェースを通じてクエリを入力します
- プロファイル選択:ユーザーは自身のプロファイルを選択します(Child, Teen, Adult, Healthcare role)
- リクエスト準備:Web インターフェースは、ユーザーコンテキストを含む認証済みリクエストを準備します
- ユーザー認証
JSON Web Token (JWT) トークン生成:Amazon Cognito のユーザープールがユーザーを認証し、JWT トークンを生成します
- ユーザーID:JWT トークンにはユーザー ID と認証クレームが含まれます
- トークン検証:安全なトークンは API リクエストと共に渡されます
- AWS WAF セキュリティレイヤー
レート制限:AWS WAF は、IP アドレスあたり 1 分間に 2,000 リクエストの制限を適用します(コードリポジトリ内の terraform/variables.tf で要件に応じて調整可能)
- Open Web Application Security Project (OWASP) プロテクション:一般的な Web 脅威と悪意のあるリクエストをブロックします
- リクエストフィルタリング:リクエスト形式を検証し、不審なトラフィックをブロックします
- API Gateway 処理
JWT 認証:API Gateway は Cognito からの JWT トークンを検証します
- リクエストルーティング:認証済みリクエストを AWS Lambda 関数にルーティングします
- Cross-Origin Resource Sharing (CORS):Web デモからのクロスオリジンリクエストを管理します
- Lambda 関数の実行
入力サニタイズ:Lambda はユーザー入力をサニタイズし、検証します
- ユーザーコンテキスト取得:DynamoDB を照会してユーザープロファイル(年齢、役割、業界)を取得します
- コンテキスト分析:ユーザーの人口統計を分析し、適切なガードレールを決定します
- DynamoDB ユーザープロファイル検索
プロファイルクエリ:Lambda は user_id を用いて ResponsiveAI-Users テーブルを照会します
- コンテキストデータ:年齢、役割、業界、およびデバイス情報を返します
- 監査準備:ResponsiveAI-Audit テーブルへの監査ログエントリを準備します
- ダイナミックガードレール選択
コンテキスト評価:AWS Lambda はユーザーの年齢、役割、業界を評価します
- ガードレールマッピング:5 つの専門化された Amazon Bedrock Guardrails から自動選択されます:
Child (Age
- セーフティ:すべてのリクエストは必ずガードレールを経由しなければならず、バイパスは不可能です
各ガードレールの設定(コンテンツフィルタ、トピック制限、PII 処理、カスタムフィルタを含む)の詳細な概要については、Code repository の Guardrail Configuration Details を参照してください。
- Guardrail を備えた Bedrock AI の処理
モデル呼び出し:Lambda が Amazon Bedrock 内の基盤モデルを呼び出します
- Guardrail の適用:選択された guardrail が入力と出力の両方をフィルタリングします
- コンテンツ安全性:カスタムポリシー、トピック制限、および個人識別情報 (PII) の検知が適用されます
- レスポンス生成:AI は文脈に適切で、安全フィルターを通過したレスポンスを生成します
- レスポンスの処理と監査ログ記録
コンテンツ承認:安全なレスポンスは guardrail メタデータと共に配信されます
- コンテンツブロック:不適切なコンテンツは、文脈に応じた安全性メッセージをトリガーします
- CloudWatch ログ記録:相互作用はコンプライアンス追跡のためにログ記録されます
- DynamoDB 監査:guardrail の相互作用は Responsive AI-Audit テーブルに保存されます
- ユーザーへのレスポンス配信
API Gateway レスポンス:Lambda は Amazon API Gateway を通じて処理済みのレスポンスを返します
- 直接応答:システムはレスポンスをユーザーに直接配信します(AWS WAF は入力リクエストのみをフィルタリングします)
- Web デモ表示:ユーザーは文脈に適切で保護されたレスポンスを受信します
- ユーザーエクスペリエンス:同じクエリでも、ユーザーの文脈に基づいて異なるレスポンスが生成されます
例示的なレスポンス適応
- 質問「DNA とは何か?」に対して、システムはユーザーの文脈に基づいて異なるレスポンスを生成します:
学生(13 歳):
「DNA は、体がどのように成長し、どのような姿になるかを示すレシピブックのようなものです!A、T、G、C という 4 つの特別な文字で構成されており、あなたに関するすべてのことについての指示を作成しています。」
医療専門家(35 歳):
「DNA は、塩基対相補性を通じて遺伝情報を符号化するヌクレオチド配列から成り立っています。二重らせん構造には、遺伝子発現とタンパク質合成を制御するコード領域(エクソン)および調節配列が含まれています。」
一般成人(28 歳):
「DNA は、生物の発生と機能に関する遺伝情報を含む分子です。これは二重らせん構造をしており、遺伝形質を決定します。」
2. 次の例は、同じ数学的な質問に対して年齢に応じた回答がどのように提供されるかを示しています:
次のスクリーンショットを参照して、「二次方程式の解き方は?」という質問への回答を確認してください。これにより、ユーザーの文脈に基づいて同じ質問でも異なる回答が得られる様子がより明確になります。
ティーンエイジャーの生徒(13 歳): 中学レベルに適した基本的な例と親しみやすい言葉を用いた、シンプルで段階的な解説(図 3 を参照)
数学教師(39 歳): 複数の解法、指導戦略、高度な数学的概念を含む包括的な教育学的アプローチ(図 4 を参照)
図3:段階的な指導を含むティーンエイジャーの学生への回答

図4:包括的な教育アプローチを含む教育者への回答

前提条件
ソリューションを展開する前に、以下のものがインストールされ、設定されていることを確認してください。
- AWS アカウント
- 必要な AWS パーミッション:AWS ユーザーまたはロールには、以下の権限が必要です。
Lambda(関数の作成)
- Amazon Bedrock(モデルの呼び出しおよびガードレールの管理)
- Cognito(ユーザープールとアイデンティティプロバイダー)
- AWS WAF(Web ACL およびルール)
- DynamoDB(テーブル操作)
- API Gateway(REST API の管理)
- CloudWatch
- Terraform:ソリューションインフラストラクチャを展開するために必要です。
実装
- GitHub リポジトリをクローンします:
ターミナルまたはコマンドプロンプトを開きます。
- リポジトリをクローンしたいディレクトリに移動します。
- 以下のコマンドを実行して、リポジトリをローカルシステムにクローンします。
git clone https://github.com/aws-samples/sample-age-responsive-context-aware-ai-bedrock-guardrails.git
- Terraform を使用してインフラストラクチャをデプロイする:
ターミナルまたはコマンドプロンプトを開き、コードリポジトリに移動します。
- deploy.sh を使用してリソースとエンドツーエンドのソリューションをデプロイします。
$ cd sample-age-responsive-context-aware-ai-bedrock-guardrails
$ ./deploy.sh
ソリューションのテスト
このソリューションには、即時テスト用の Web ベースのデモと、高度な API テスト機能が用意されています。
本番環境での企業向けデプロイでは、Web インターフェースを AWS Amplify、Amazon S3、Amazon CloudFront でホストするか、Amazon Elastic Container Service (Amazon ECS) や Amazon Elastic Kubernetes Service (Amazon EKS) などのコンテナサービスを使用してください。詳細な Amazon Bedrock Guardrails のテストシナリオ、API の例、および検証手順については、クローンしたリポジトリ内の TESTING_GUIDE.md ファイルを参照してください。
インタラクティブ Web デモ:
- インタラクティブな Web デモを開始するには、以下を実行します:
$ cd web-demo
$ ./start_demo.sh
- ブラウザを開き、http://localhost:8080 に移動します。
- デモインターフェースを使用して、以下のことができます:
異なるユーザープロファイル(Child, Teen, Adult, Healthcare roles)を選択する
- クエリを送信し、文脈に応じた応答を観察する
- ガードレールの適用状況をリアルタイムで表示する
- ユーザーの文脈に基づいた応答の適応を監視する
API テスト:
- プログラムによるテストを行う場合は、JWT トークンを生成してください:
$ cd utils
$ python3 generate_jwt.py student-123
Tes
原文を表示
As you deploy generative AI applications to diverse user groups, you might face a significant challenge that impacts user safety and application reliability: verifying each AI response is appropriate, accurate, and safe for the specific user receiving it. Content suitable for adults might be inappropriate or confusing for children, while explanations designed for beginners might be insufficient for domain experts. As AI adoption accelerates across industries, the need to match responses to user age, role, and domain knowledge has become essential for production deployments.
You might attempt to address this through prompt engineering or application-level logic. However, these approaches can create significant challenges. Prompt-based safety controls can be bypassed through manipulation techniques that tricks models into ignoring safety instructions. Application code becomes complex and fragile as personalization requirements grow, and governance becomes inconsistent across different AI applications. Furthermore, the risks of unsafe content, hallucinated information, and inappropriate responses are amplified when AI systems interact with vulnerable users or operate in sensitive domains like education and healthcare. The lack of centralized, enforceable safety policies creates operational inefficiencies and compliance risks.
To address these challenges, we implemented a fully serverless, guardrail-first solution using Amazon Bedrock Guardrails and other AWS services that align with modern AI safety and compliance alignment needs. The architecture provides three main components: dynamic guardrail selection based on user context, centralized policy enforcement through Amazon Bedrock Guardrails, and more secure APIs for authenticated access. You can use this serverless design to deliver personalized, safe AI responses without complex application code more efficiently, securely, and at scale.
In this post, we walk you through how to implement a fully automated, context-aware AI solution using a serverless architecture on AWS. We demonstrate how to design and deploy a scalable system that can:
- Adapt AI responses intelligently based on user age, role, and industry
- Enforce safety policies at inference time that help prevent bypasses by prompt manipulation
- Provide five specialized guardrails for different user segments (children, teens, healthcare professionals, patients, and general adults)
- Enhance operational efficiency with centralized governance and minimal manual intervention
- Scale with user growth and evolving safety requirements
This solution helps organizations looking to deploy responsible AI systems, align with compliance requirements for vulnerable populations, and help maintain appropriate and trustworthy AI responses across diverse user groups without compromising performance or governance.
Solution overview
This solution uses Amazon Bedrock, Amazon Bedrock Guardrails, AWS Lambda, and Amazon API Gateway as core services for intelligent response generation, centralized policy enforcement, and secure access. Supporting components such as Amazon Cognito, Amazon DynamoDB, AWS WAF, and Amazon CloudWatch help enable user authentication, profile management, security, and comprehensive logging.
What makes this approach unique is dynamic guardrail selection, where Amazon Bedrock and Bedrock Guardrails automatically adapt based on authenticated user context (age, role, industry) to help enforce appropriate safety policies at inference time. This guardrail-first approach works alongside prompt-based safety measures to provide layered protection, offering five specialized guardrails: Child Protection (Children’s Online Privacy Protection Act or COPPA-compliant), Teen Educational, Healthcare Professional, Healthcare Patient, and Adult General. These guardrails provide an authoritative policy enforcement layer that governs what the AI model is allowed to say, operating independently of application logic.
The solution uses serverless scalability, enforces safety policies, and adapts responses based on user context—making it well-suited for enterprise AI deployments serving diverse user populations. The solution can be deployed using Terraform, enabling repeatable and end-to-end automation of infrastructure and application components.
As shown in Figure 1, the web UI runs as a local demo server (localhost:8080) for testing and demonstration purposes. For production deployments, organizations can integrate the API endpoints with their existing web applications or deploy the interface to AWS services such as Amazon Simple Storage Service (Amazon S3) with Amazon CloudFront or AWS Amplify.

*Figure 1: Serverless *age-responsive-context-aware-ai-bedrock Architecture* *
Multi-context AI safety strategy
Now that you understand the architecture components, let’s examine how the solution dynamically adapts responses based on different user contexts.The following diagram (Figure 2: age-responsive, context-aware AI with Amazon Bedrock Guardrails workflow) shows how different user profiles are handled:

** * Figure 2: *age-responsive-context-aware-ai-bedrock Workflow* *
How the solution works
The solution workflow includes the following steps (refer to Figure 1: Solution architecture for age-responsive, context-aware AI with Amazon Bedrock Guardrails):
- User request and web interface
Web Interface: User accesses the local demo web interface (runs on localhost:8080 for demonstration purposes)
- User Input: User enters query through a web interface
- User Selection: User selects their profile (Child, Teen, Adult, Healthcare role)
- Request Preparation: Web interface prepares authenticated request with user context
- User authentication
JSON Web Token (JWT) Token Generation: The Amazon Cognito user pool authenticates users and generates JWT tokens
- User Identity: JWT tokens contain user ID and authentication claim
- Token Validation: Secure tokens are passed with the API requests
- AWS WAF security layer
Rate Limiting: AWS WAF applies 2,000 requests per minute limit per IP (adjustable in terraform/variables.tf in Code repository based on your requirements)
- Open Web Application Security Project (OWASP) Protection: Blocks common web threats and malicious requests
- Requests Filtering: Validates request format and blocks suspicious traffic
- API Gateway processing
JWT Authorization: API Gateway validates JWT tokens from Cognito
- Request Routing: Routes authenticated requests to AWS Lambda functions
- Cross-Origin Resource Sharing (CORS): Manages cross-origin requests from the web demo
- Lambda function execution
Input Sanitization: Lambda sanitizes and validates user inputs
- User Context Retrieval: Queries DynamoDB to retrieve user profiles (age, role, industry)
- Context Analysis: Analyzes user demographics to determine the appropriate guardrail
- DynamoDB user profile lookup
Profile Query: Lambda queries the ResponsiveAI-Users table with user_id
- Context Data: Returns age, role, industry, and device information
- Audit Preparation: Prepares audit log entries for the ResponsiveAI-Audit table
- Dynamic guardrail selection
Context Evaluation: AWS Lambda evaluates user age, role, and industry
- Guardrail Mapping: Automatic selection from five specialized Amazon Bedrock Guardrails:
Child (Age
- Safety: Every request must go through a guardrail—no bypass is possible
For a comprehensive overview of each guardrail’s configuration, including content filters, topic restrictions, PII handling, and custom filters, refer to the Guardrail Configuration Details in the Code repository.
- Bedrock AI processing with guardrail protection
Model Invocation: Lambda invokes foundation model in Amazon Bedrock
- Guardrail Application: The selected guardrail filters both input and output
- Content Safety: Custom policies, topic restrictions, and personally identifiable information (PII) detection are applied
- Response Generation: The AI generates context-appropriate, safety-filtered responses
- Response processing and audit logging
Content Approval: Safe responses are delivered with guardrail metadata
- Content Blocking: Inappropriate content triggers context-aware safety messages
- CloudWatch Logging: Interactions are logged for compliance tracking
- DynamoDB Audit: Guardrail interactions are stored in the Responsive AI-Audit table
- Response delivery to user
API Gateway Response: Lambda returns processed responses through Amazon API Gateway
- Direct Response: The system delivers responses directly to users (AWS WAF only filters incoming requests)
- Web Demo Display: Users receive context-appropriate, protected responses
- User Experience: The same query generates different responses based on user context
Example response adaptation
1.** For the question “What is DNA?”, the system generates different responses based on user context:
Student (Age 13):
“DNA is like a recipe book that tells your body how to grow and what you’ll look like! It’s made up of four special letters (A, T, G, C) that create instructions for everything about you.”
Healthcare Professional (Age 35):
“DNA consists of nucleotide sequences encoding genetic information through base pair complementarity. The double helix structure contains coding regions (exons) and regulatory sequences that control gene expression and protein synthesis.”
General Adult (Age 28):
“DNA is a molecule that contains genetic instructions for the development and function of living organisms. It’s structured as a double helix and determines inherited traits.”
2. The following example demonstrates how the same mathematical question receives age-appropriate responses:
Refer to the following screenshots for responses to the question: “How do I solve quadratic equations?” This makes it clearer how the same question gets different responses based on user context.
Teen Student (Age 13): Simple, step-by-step explanation with basic examples and friendly language suitable for middle school level (refer Figure 3)
For Math Teacher (Age 39): Comprehensive pedagogical approach including multiple solution methods, teaching strategies, and advanced mathematical concepts (refer to Figure 4)

** * Figure 3: Teen *Student response with step-by-step guidance* *

- Figure 4: *Educator response with comprehensive teaching approach
Prerequisites
Before deploying the solution, make sure that you have the following installed and configured:
- AWS account
- Required AWS Permissions: Your AWS user or role needs permissions for:
Lambda (create functions)
- Amazon Bedrock (model invocation and guardrail management)
- Cognito (user pools and identity providers)
- AWS WAF (web ACLs and rules)
- DynamoDB (table operations)
- API Gateway (REST API management)
- CloudWatch
- Terraform installed: Required to deploy the solution infrastructure
Implementation
- Clone the GitHub repository:
Open your terminal or command prompt.
- Navigate to the directory where you want to clone the repository.
- Run the following command to clone the repository into the local system.
git clone https://github.com/aws-samples/sample-age-responsive-context-aware-ai-bedrock-guardrails.git- Deploy infrastructure using Terraform:
Open your terminal or command prompt and navigate to the code repository.
- Use the deploy.sh to deploy the resources and the end-to-end solution.
$ cd sample-age-responsive-context-aware-ai-bedrock-guardrails
$ ./deploy.shTesting the solution
The solution includes a web-based demo for immediate testing and advanced API testing capabilities.
For production enterprise deployments, host the web interface using AWS Amplify, Amazon S3 and Amazon CloudFront, or container services like Amazon Elastic Container Service (Amazon ECS) and Amazon Elastic Kubernetes Service (Amazon EKS). For detailed Amazon Bedrock Guardrails testing scenarios, API examples, and validation procedures, refer to the TESTING_GUIDE.md file in the cloned repository.
Interactive web demo**:
- To start the interactive web demo run:
$ cd web-demo
$ ./start_demo.sh- Open your browser and navigate to http://localhost:8080
- You can use the demo interface to:
Select different user profiles (Child, Teen, Adult, Healthcare roles)
- Submit queries and observe context-aware responses
- View guardrail enforcement in real-time
- Monitor response adaptation based on user context
API testing :
- For programmatic testing, generate a JWT token:
$ cd utils
$ python3 generate_jwt.py student-123Tes
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み