Amazon Bedrock Automated Reasoning
SkillCommerce & financeAmazon Bedrock Automated Reasoning for mathematical verification of AI responses against formal policy rules with up to 99% accuracy. Use when validating healthcare protocols, financial compliance, legal regulations, insurance policies, or any domain requiring deterministic verification of AI-generated content.
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the Amazon Bedrock Automated Reasoning skill
What this skill tells your AI
The instructions your AI receives, as published by fdu-ins/insurance-skills in Skills/bedrock-automated-reasoning/SKILL.md and read by ahel’s review.
Overview
Amazon Bedrock Automated Reasoning provides mathematical verification of AI-generated responses against formal policy rules, achieving up to 99% verification accuracy. Unlike probabilistic content filtering, Automated Reasoning uses formal logic and theorem-proving techniques to deterministically validate whether AI outputs comply with explicit policy requirements.
GA Status: Generally Available as of December 2025
Key Innovation: Combines generative AI flexibility with formal verification precision—get creative, contextual responses that are mathematically proven to comply with your policies.
How It Works
- Policy Definition: Upload policy documents (PDF, Word, text) containing rules and requirements
- Rule Extraction: AWS extracts formal logical rules from natural language policies
- Verification: Each AI response is mathematically validated against extracted rules
- Results: Valid (complies), Invalid (violates policy), or No Data (insufficient information)
Core Capabilities
- Mathematical Verification: Theorem-proving techniques ensure deterministic validation
- Natural Language Policies: Upload existing policy documents (no Cedar/formal language required)
- 99% Accuracy: Industry-leading verification accuracy for policy compliance
- Explanatory Feedback: Detailed explanations when policies are violated, with suggested corrections
- Multi-Domain Support: Healthcare, finance, legal, insurance, customer service, and more
Integration Points
- Bedrock Guardrails: Add automated reasoning as 6th safeguard policy
- AgentCore Policy: Combine with Cedar policies for comprehensive agent governance
- Knowledge Bases: Validate RAG responses against domain policies
- Multi-Model: Works with any foundation model (Claude, Nova, Titan, GPT, Gemini)
When to Use
Use bedrock-automated-reasoning when:
- Validating healthcare responses against HIPAA, clinical protocols, or treatment guidelines
- Ensuring financial advice complies with regulations (SEC, FINRA, Dodd-Frank)
- Verifying legal responses against jurisdiction-specific statutes
- Validating insurance claim decisions against policy terms
- Enforcing customer service response standards
- Ensuring compliance with industry-specific regulations
- Requiring deterministic (not probabilistic) policy enforcement
- Needing audit trails for regulatory compliance
When NOT to Use:
- General content safety (use content filters instead)
- PII detection (use sensitive information policy)
- Hallucination detection in RAG (use contextual grounding)
- Real-time streaming responses (not supported for automated reasoning)
- Creative writing without policy constraints
- Simple keyword filtering (use word filters)
Prerequisites
Required
- AWS account with Bedrock access
- Policy documents (PDF, Word, or text format)
- IAM permissions for Bedrock operations
- S3 bucket for policy storage
Recommended
- Understanding of your domain policies
- Test cases representing policy compliance/violations
- Integration with CloudWatch for monitoring
- Guardrail or agent infrastructure already configured
IAM Permissions
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"bedrock:CreateAutomatedReasoningPolicy",
"bedrock:GetAutomatedReasoningPolicy",
"bedrock:UpdateAutomatedReasoningPolicy",
"bedrock:DeleteAutomatedReasoningPolicy",
"bedrock:ListAutomatedReasoningPolicies",
"bedrock:CreateGuardrail",
"bedrock:UpdateGuardrail",
"bedrock-runtime:ApplyGuardrail"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject"
],
"Resource": "arn:aws:s3:::your-policy-bucket/*"
}
]
}
Operations
Operation 1: Create Automated Reasoning Policy
Time: 5-15 minutes (depending on policy size) Automation: 90% Purpose: Extract formal rules from policy documents
Upload Policy Document to S3
import boto3
s3_client = boto3.client('s3', region_name='us-east-1')
bucket_name = 'my-policy-documents'
# Upload healthcare policy document
with open('hipaa-clinical-protocols.pdf', 'rb') as f:
s3_client.put_object(
Bucket=bucket_name,
Key='healthcare/hipaa-clinical-protocols.pdf',
Body=f
)
print(f"Uploaded policy to s3://{bucket_name}/healthcare/hipaa-clinical-protocols.pdf")
Create Automated Reasoning Policy
import boto3
bedrock_client = boto3.client('bedrock', region_name='us-east-1')
# Create automated reasoning policy from PDF
response = bedrock_client.create_automated_reasoning_policy(
name='healthcare-hipaa-policy',
description='HIPAA compliance and clinical protocol validation for healthcare AI',
policyDocument={
's3Uri': 's3://my-policy-documents/healthcare/hipaa-clinical-protocols.pdf'
}
)
policy_id = response['policyId']
policy_arn = response['policyArn']
status = response['status'] # CREATING, ACTIVE, FAILED
print(f"Created AR policy: {policy_id}")
print(f"ARN: {policy_arn}")
print(f"Status: {status}")
Wait for Policy to be Active
import time
def wait_for_policy_active(bedrock_client, policy_id, max_attempts=30):
"""Wait for automated reasoning policy to become active"""
for attempt in range(max_attempts):
response = bedrock_client.get_automated_reasoning_policy(
policyId=policy_id
)
status = response['status']
print(f"Attempt {attempt + 1}: Status = {status}")
if status == 'ACTIVE':
print(f"Policy is active. Extracted {response.get('ruleCount', 'unknown')} rules.")
return response
elif status == 'FAILED':
failure_reason = response.get('failureReason', 'Unknown error')
raise Exception(f"Policy creation failed: {failure_reason}")
time.sleep(10) # Wait 10 seconds between checks
raise TimeoutError(f"Policy did not become active after {max_attempts} attempts")
# Wait for policy to be ready
policy_info = wait_for_policy_active(bedrock_client, policy_id)
print(f"\nPolicy ready with {policy_info.get('ruleCount')} extracted rules")
Policy Document Format Examples
Healthcare Policy (HIPAA + Clinical Protocols):
HIPAA Privacy and Clinical Protocol Requirements
1. Patient Information Protection
- Never disclose patient names, addresses, or social security numbers
- Always use de-identified data in examples
- Require explicit consent before sharing medical records
2. Clinical Decision Support
- Medication recommendations must cite evidence-based guidelines
- Dosage suggestions must be within FDA-approved ranges
- All diagnoses must include differential considerations
- Treatment plans must align with established clinical pathways
3. Emergency Protocols
- Life-threatening conditions require immediate emergency service referral
- Chest pain, difficulty breathing, or stroke symptoms = immediate 911
- No AI-based diagnosis for emergency conditions
4. Scope Limitations
- Do not provide specific medical diagnoses
- Do not prescribe medications
- Always recommend consulting healthcare provider for treatment decisions
Financial Compliance (SEC Regulations):
SEC and FINRA Compliance Requirements
1. Investment Advice Standards
- Never guarantee investment returns
- All recommendations must include risk disclosures
- Past performance must include "not indicative of future results" disclaimer
- Material conflicts of interest must be disclosed
2. Suitability Requirements
- Assess investor risk tolerance before recommendations
- Match investments to stated financial goals
- Consider investor time horizon and liquidity needs
- Document rationale for all recommendations
3. Prohibited Practices
- No recommendations of unregistered securities
- No market manipulation or insider trading references
- No misleading statements about investment characteristics
- No omission of material adverse information
Insurance Policy Validation:
Auto Insurance Claim Policy Requirements
1. Coverage Validation
- Verify policy is active at time of incident
- Confirm incident type is covered under policy terms
- Check coverage limits before approval
- Validate deductible requirements
2. Claim Amount Limits
- Property damage claims: Max $50,000 without supervisor approval
- Bodily injury claims: Max $25,000 without medical review
- Total loss claims: Must not exceed vehicle book value
- Rental reimbursement: Max $30/day for 30 days
3. Required Documentation
- Police report required for claims over $5,000
- Photo evidence required for all property damage claims
- Medical records required for injury claims over $1,000
- Witness statements required for disputed liability
4. Exclusions
- No coverage for intentional damage
- No coverage for commercial use of personal vehicle
- No coverage for racing or competitive events
- No coverage for uninsured motorist if policy lacks that coverage
Operation 2: Create Test Cases
Time: 10-20 minutes Automation: 85% Purpose: Validate automated reasoning policy with test scenarios
Define Test Scenarios
import boto3
import json
bedrock_client = boto3.client('bedrock', region_name='us-east-1')
# Healthcare test cases
healthcare_test_cases = [
{
'name': 'HIPAA Violation - Patient Name Disclosure',
'ai_response': 'Patient John Smith, SSN 123-45-6789, has been diagnosed with diabetes.',
'expected_result': 'Invalid',
'policy_violated': 'Patient Information Protection - Never disclose patient names or SSN'
},
{
'name': 'HIPAA Compliant - De-identified Data',
'ai_response': 'Patient presents with Type 2 diabetes. Treatment plan includes metformin 500mg twice daily, consistent with ADA guidelines.',
'expected_result': 'Valid',
'policy_violated': None
},
{
'name': 'Clinical Protocol Violation - Dosage Out of Range',
'ai_response': 'Recommend starting patient on metformin 5000mg daily.',
'expected_result': 'Invalid',
'policy_violated': 'Dosage suggestions must be within FDA-approved ranges'
},
{
'name': 'Emergency Protocol Violation - No 911 Referral',
'ai_response': 'For chest pain, try taking aspirin and rest. See your doctor tomorrow.',
'expected_result': 'Invalid',
'policy_violated': 'Chest pain requires immediate 911 referral'
},
{
'name': 'Scope Limitation Violation - Specific Diagnosis',
'ai_response': 'Based on your symptoms, you have acute appendicitis.',
'expected_result': 'Invalid',
'policy_violated': 'Do not provide specific medical diagnoses'
},
{
'name': 'Compliant - General Information',
'ai_response': 'Chest pain can have many causes. Given the serious nature, please call 911 immediately for evaluation.',
'expected_result': 'Valid',
'policy_violated': None
}
]
Create Test Cases in Bedrock
def create_test_case(bedrock_client, policy_id, test_case):
"""Create a test case for automated reasoning policy"""
response = bedrock_client.create_automated_reasoning_test_case(
policyId=policy_id,
name=test_case['name'],
content=test_case['ai_response'],
expectedResult=test_case['expected_result'],
description=f"Policy: {test_case.get('policy_violated', 'N/A')}"
)
return response['testCaseId']
# Create all test cases
test_case_ids = []
for test_case in healthcare_test_cases:
test_case_id = create_test_case(bedrock_client, policy_id, test_case)
test_case_ids.append(test_case_id)
print(f"Created test case: {test_case['name']} ({test_case_id})")
print(f"\nCreated {len(test_case_ids)} test cases")
Run Test Suite
def run_test_suite(bedrock_client, policy_id, test_case_ids):
"""Run automated reasoning test suite"""
results = []
for test_case_id in test_case_ids:
# Get test case details
test_case = bedrock_client.get_automated_reasoning_test_case(
policyId=policy_id,
testCaseId=test_case_id
)
# Run validation
response = bedrock_client.validate_automated_reasoning_test_case(
policyId=policy_id,
testCaseId=test_case_id
)
result = {
'name': test_case['name'],
'expected': test_case['expectedResult'],
'actual': response['result'],
'passed': response['result'] == test_case['expectedResult'],
'explanation': response.get('explanation', ''),
'suggestion': response.get('suggestion', '')
}
results.append(result)
print(f"\nTest: {result['name']}")
print(f" Expected: {result['expected']}")
print(f" Actual: {result['actual']}")
print(f" Passed: {result['passed']}")
if not result['passed']:
print(f" Explanation: {result['explanation']}")
# Summary
total = len(results)
passed = sum(1 for r in results if r['passed'])
print(f"\n{'='*60}")
print(f"Test Suite Summary: {passed}/{total} passed ({100*passed/total:.1f}%)")
print(f"{'='*60}")
return results
# Run all tests
test_results = run_test_suite(bedrock_client, policy_id, test_case_ids)
Operation 3: Validate AI Response
Time: < 1 second per validation Automation: 100% Purpose: Check model output against automated reasoning policy
Validate Individual Response
import boto3
bedrock_runtime = boto3.client('bedrock-runtime', region_name='us-east-1')
def validate_ai_response(ai_response, policy_arn):
"""
Validate AI-generated response against automated reasoning policy
Returns:
- Valid: Response complies with policy
- Invalid: Response violates policy (includes explanation and suggestion)
- No Data: Insufficient information to determine compliance
"""
# Create temporary guardrail with AR policy for validation
# (In production, reuse existing guardrail)
bedrock_client = boto3.client('bedrock', region_name='us-east-1')
guardrail_response = bedrock_client.create_guardrail(
name='temp-ar-validation',
description='Temporary guardrail for AR validation',
automatedReasoningPolicyConfig={
'policyArn': policy_arn
}
)
guardrail_id = guardrail_response['guardrailId']
# Wait for guardrail to be ready (simplified)
time.sleep(5)
# Validate response
validation_response = bedrock_runtime.apply_guardrail(
guardrailIdentifier=guardrail_id,
guardrailVersion='DRAFT',
source='OUTPUT',
content=[
{
'text': {
'text': ai_response,
'qualifiers': ['guard_content']
}
}
]
)
action = validation_response['action']
if action == 'GUARDRAIL_INTERVENED':
# Policy violation detected
for assessment in validation_response['assessments']:
if 'automatedReasoningChecks' in assessment:
ar_checks = assessment['automatedReasoningChecks']
return {
'valid': False,
'result': ar_checks.get('result'), # Valid, Invalid, No Data
'explanation': ar_checks.get('explanation', ''),
'suggestion': ar_checks.get('suggestion', ''),
'violated_rules': ar_checks.get('violatedRules', [])
}
# Clean up temporary guardrail
bedrock_client.delete_guardrail(guardrailIdentifier=guardrail_id)
return {
'valid': True,
'result': 'Valid',
'message': 'Response complies with policy'
}
# Example: Healthcare validation
ai_response = """
Patient John Doe has diabetes. Recommend metformin 500mg twice daily.
"""
result = validate_ai_response(ai_response, policy_arn)
if result['valid']:
print("Response is policy-compliant")
else:
print(f"Policy violation detected: {result['explanation']}")
if result['suggestion']:
print(f"Suggested fix: {result['suggestion']}")
Validate in Production Pipeline
def generate_and_validate(user_query, policy_arn, guardrail_id, guardrail_version):
"""
Complete pipeline: Generate AI response and validate against policy
"""
bedrock_runtime = boto3.client('bedrock-runtime', region_name='us-east-1')
# Step 1: Generate AI response
response = bedrock_runtime.converse(
modelId='anthropic.claude-3-5-sonnet-20241022-v2:0',
messages=[
{
'role': 'user',
'content': [{'text': user_query}]
}
]
)
ai_response = response['output']['message']['content'][0]['text']
# Step 2: Validate against automated reasoning policy
validation = bedrock_runtime.apply_guardrail(
guardrailIdentifier=guardrail_id,
guardrailVersion=guardrail_version,
source='OUTPUT',
content=[
{
'text': {
'text': ai_response,
'qualifiers': ['guard_content']
}
}
]
)
if validation['action'] == 'GUARDRAIL_INTERVENED':
# Check if automated reasoning failed
for assessment in validation['assessments']:
if 'automatedReasoningChecks' in assessment:
ar_checks = assessment['automatedReasoningChecks']
if ar_checks['result'] == 'Invalid':
# Policy violation - return error with explanation
return {
'success': False,
'error': 'Policy violation',
'explanation': ar_checks.get('explanation', ''),
'suggestion': ar_checks.get('suggestion', ''),
'original_response': ai_response
}
# Response is valid
return {
'success': True,
'response': ai_response
}
# Usage example
result = generate_and_validate(
user_query="What medication should I take for diabetes?",
policy_arn='arn:aws:bedrock:us-east-1:123456789012:automated-reasoning-policy/healthcare-policy',
guardrail_id='healthcare-guardrail-id',
guardrail_version='1'
)
if result['success']:
print(f"Response: {result['response']}")
else:
print(f"Error: {result['error']}")
print(f"Explanation: {result['explanation']}")
Operation 4: Integrate with Bedrock Guardrails
Time: 10-15 minutes Automation: 90% Purpose: Add automated reasoning as 6th safeguard policy
Create Comprehensive Guardrail with AR
import boto3
bedrock_client = boto3.client('bedrock', region_name='us-east-1')
# Assume AR policy already created
ar_policy_arn = 'arn:aws:bedrock:us-east-1:123456789012:automated-reasoning-policy/healthcare-policy'
# Create guardrail with all 6 safeguard policies
response = bedrock_client.create_guardrail(
name='healthcare-comprehensive-guardrail',
description='Healthcare guardrail with content filtering, PII protection, and automated reasoning',
# Policy 1: Content Filtering
contentPolicyConfig={
'filtersConfig': [
{'type': 'HATE', 'inputStrength': 'HIGH', 'outputStrength': 'HIGH'},
{'type': 'VIOLENCE', 'inputStrength': 'HIGH', 'outputStrength': 'HIGH'},
{'type': 'SEXUAL', 'inputStrength': 'HIGH', 'outputStrength': 'HIGH'},
{'type': 'MISCONDUCT', 'inputStrength': 'MEDIUM', 'outputStrength': 'MEDIUM'},
{'type': 'PROMPT_ATTACK', 'inputStrength': 'HIGH', 'outputStrength': 'NONE'}
]
},
# Policy 2: PII Protection (HIPAA-compliant)
sensitiveInformationPolicyConfig={
'piiEntitiesConfig': [
{'type': 'NAME', 'action': 'ANONYMIZE'},
{'type': 'ADDRESS', 'action': 'ANONYMIZE'},
{'type': 'EMAIL', 'action': 'ANONYMIZE'},
{'type': 'PHONE', 'action': 'ANONYMIZE'},
{'type': 'US_SOCIAL_SECURITY_NUMBER', 'action': 'BLOCK'},
{'type': 'DRIVER_ID', 'action': 'ANONYMIZE'},
{'type': 'US_PASSPORT_NUMBER', 'action': 'BLOCK'},
{'type': 'CREDIT_CARD_NUMBER', 'action': 'BLOCK'}
],
'regexesConfig': [
{
'name': 'MedicalRecordNumber',
'description': 'Medical record number pattern',
'pattern': r'MRN-\d{7}',
'action': 'ANONYMIZE'
},
{
'name': 'InsuranceID',
'description': 'Insurance policy number',
'pattern': r'INS-[A-Z]{2}\d{8}',
'action': 'ANONYMIZE'
}
]
},
# Policy 3: Topic Denial
topicPolicyConfig={
'topicsConfig': [
{
'name': 'Specific Medical Diagnosis',
'definition': 'Providing definitive medical diagnoses',
'examples': [
'You have cancer',
'You definitely have diabetes',
'This is appendicitis'
],
'type': 'DENY'
},
{
'name': 'Prescription Medication',
'definition': 'Prescribing specific medications or dosages',
'examples': [
'Take 500mg of metformin',
'I prescribe you antibiotics',
'Start taking this medication'
],
'type': 'DENY'
},
{
'name': 'Non-Medical Advice',
'definition': 'Legal, financial, or insurance advice',
'examples': [
'You should sue your doctor',
'Invest in this health stock',
'File a malpractice claim'
],
'type': 'DENY'
}
]
},
# Policy 4: Word Filters
wordPolicyConfig={
'wordsConfig': [
{'text': 'guaranteed cure'},
{'text': 'miracle treatment'},
{'text': 'FDA unapproved'},
{'text': 'experimental drug'},
{'text': 'off-label use'}
],
'managedWordListsConfig': [
{'type': 'PROFANITY'}
]
},
# Policy 5: Contextual Grounding (for RAG-based healthcare info)
contextualGroundingPolicyConfig={
'filtersConfig': [
{'type': 'GROUNDING', 'threshold': 0.85}, # High threshold for medical accuracy
{'type': 'RELEVANCE', 'threshold': 0.80}
]
},
# Policy 6: Automated Reasoning (HIPAA + Clinical Protocols)
automatedReasoningPolicyConfig={
'policyArn': ar_policy_arn
}
)
guardrail_id = response['guardrailId']
guardrail_version = response['version']
print(f"Created comprehensive healthcare guardrail:")
print(f" ID: {guardrail_id}")
print(f" Version: {guardrail_version}")
print(f" Includes 6 safeguard policies with automated reasoning")
Use Guardrail with Agent
bedrock_agent = boto3.client('bedrock-agent', region_name='us-east-1')
Shortened here. Read the whole file on GitHub.
Signals
- GitHub stars
- 73
- Forks
- 19
- Last commit
- Jul 2026
Advanced
- Catalog kind
- skill
- Gateway key
bedrock-automated-reasoning- Source
- github.com/fdu-ins/insurance-skills