기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
자동 추론 정책과 함께 Kiro CLI 사용
Kiro CLI를 사용하여 자동 추론 정책에 대해 질문하고, 다양한 규칙의 동작을 이해하고, 정책 자체의 테스트 실패 또는 모호성을 해결하는 변경을 요청할 수 있습니다.
사전 조건
자동 추론 정책과 함께 Kiro CLI를 사용하려면 먼저 다음 단계를 완료해야 합니다.
-
최신 버전의 Kiro CLI
를 설치합니다. -
AWS CLI의 최신 버전을 설치합니다.
-
콘솔 또는 APIs를 통해 문서를 사용하여 자동 추론 정책을 생성합니다. 빠르게 시작하려면 콘솔의 기본 제공 샘플 홈워크 정책을 사용합니다. 자세한 내용은 자동 추론 정책 생성 단원을 참조하십시오.
-
에 제공된 컨텍스트 프롬프트의 콘텐츠를 복사자동 추론 정책 API 컨텍스트 프롬프트하여 프로젝트 폴더의 마크다운 파일에 저장합니다. 이 프롬프트는 Kiro CLI가 자동 추론 정책 컨트롤 플레인을 사용하고 API를 올바르게 테스트하는 데 도움이 됩니다.
참고
아래 프롬프트 예제에서는 샘플 숙제 정책을 사용합니다. 프롬프트는 다른 정책과 마찬가지로 작동해야 하며 강조 표시된 주제를 변경하기만 하면 됩니다.
참고
자동화된 추론 정책은 복잡할 수 있으며 Kiro CLI가 복잡한 논리적 구조를 통해 추론해야 합니다. 최상의 성능을 위해 Anthropic Sonnet 4.5와 같은 더 큰 LLMs 사용하는 것이 좋습니다. Kiro CLI에서 모델을 변경하려면 /model 명령을 사용합니다.
시작하기
Kiro CLI를 사용하여 워크플로를 시작하려면 생성한 자동 추론 정책의 ARN이 필요합니다.
-
콘솔을 사용하여 자동 추론 정책을 열고 정책 개요 페이지에서 정책 세부 정보 탭을 엽니다.
-
정책 세부 정보 탭에서 정책 ARN을 찾아 클립보드에 복사합니다.
-
터미널을 사용하여 다음 명령을 사용하여 Kiro CLI 세션을 시작합니다.
kiro-cli -
첫 번째 프롬프트를 통해 Kiro에게 사전 조건의 일부로이 페이지에서 복사한 마크다운 파일에 대한 지침을 찾도록 요청합니다. 예제:
We will be using Automated Reasoning checks control plane APIs. I have saved an instructions file calledyour_file_name.md in this folder. Read this file as it will give you the context you need to work with the APIs. -
Kiro CLI가 자동 추론 검사의 APIs를 로드하고 이해한 후 정책의 최신 빌드를 로드하고 탐색을 시작하도록 요청합니다. 복사한 ARN과 함께 다음 프롬프트의 변형을 사용합니다.
Load the policy assets for the latest build of the policy with ARNYOUR_POLICY_ARN. Make sure you understand the policy with all its rules and variables. Give a high-level description of the policy and the type of content it is capable of validating.
이때 Kiro CLI는 정책의 규칙 및 변수에 대한 간략한 설명을 제공해야 합니다. 또한 Kiro CLI는 정책 품질 보고서를 로드하고 미사용 유형 및 변수와 같은 문제를 요약해야 합니다.
정책 문제 해결
Kiro CLI를 사용하여 정책 보고서에 보고된 정책 문제를 해결할 수 있습니다. 먼저 Kiro에게 품질 보고서 요약을 제공하도록 요청합니다.
Can you give me a summary of the quality report for this policy?
품질 보고서에는 미사용 변수, 충돌하는 규칙, 연결 해제된 규칙 및 정책의 기타 잠재적 문제 목록이 포함됩니다.
규칙이 충돌하면 정책이 모든 검증 요청에 응답IMPOSSIBLE합니다. Kiro CLI에 충돌을 설명하고 솔루션을 제안하도록 요청할 수 있습니다.
Can you look at the conflicting rules, explain how they are used in the policy, why they conflict, and suggest a change such as deleting one of the rules or merging the logic from the two into a single rule?
사용되지 않는 변수로 인해 검증 결과가 TRANSLATION_AMBIGUOUS 결과를 반환할 수 있습니다. Kiro CLI에이 문제에 대한 도움을 요청할 수 있습니다.
I see the quality report lists some unused variables, can you get rid of them?
마찬가지로 의미상 유사한 모호한 변수로 인해 검증 결과가 TRANSLATION_AMBIGUOUS 결과를 반환할 수 있습니다. Kiro CLI에이 문제에 대한 도움을 요청할 수 있습니다.
Automated Reasoning checks translate input natural language into logical statements that use the schema of variables from the policy. Variables that are semantically similar - ambiguous - can cause issues with inconsistent translations. Can you take a look at the schema of variables and help me identify variables that have potentially overlapping meanings? If you find any, suggest changes like removing one of them or merging them. Variable changes are also likely to require corresponding rule changes.
참고
일부 변경 사항을 처리한 후 Kiro CLI는 변경 사항을 적용하라는 확인을 요청합니다. 이때 Bedrock 콘솔 사용자 인터페이스를 사용하여 diff 화면에서 제안된 변경 사항을 검토할 수 있습니다. 콘솔을 사용하여 변경 사항을 검토하고 승인하는 경우 정책 정의의 최신 빌드를 다시 로드하도록 Kiro CLI에 알리는 것을 잊지 마세요.
정책과의 상호 작용
Kiro CLI를 사용하여 정책을 탐색할 수 있습니다. 예를 들어 Kiro CLI에 특정 영역과 관련된 정책 규칙을 요약하도록 요청할 수 있습니다. 샘플 숙제 정책을 예로 들어 Kiro CLI에 수학 숙제를 구체적으로 제약하는 규칙에 대해 알려주도록 요청할 수 있습니다.
Can you tell me about the rules that constrainmath homework? Explain the rules themselves and how they fit in the broader policy.
Kiro CLI를 사용하여 정책에 기능을 추가할 수도 있습니다. 자동 추론 정책은 종종 사용자 의도를 캡처하는 일부 주요 출력 변수를 다룹니다. 예를 들어 샘플 숙제 제출 정책은 isSubmissionAcceptable 변수를 규칙의 출력으로 사용합니다. Kiro CLI를 사용하여 정책을 변경하여 다른 가능한 사용자 질문을 캡처할 수 있습니다.
정책 편집 또는 수정
정책이 사용자의 특정 질문을 검증할 수 있는지 Kiro CLI에 문의할 수 있습니다. 예를 들어 숙제 정책은 숙제 제출이 허용되는지 여부를 결정하는 데 중점을 둡니다. 다음 질문을 통해 Kiro CLI에서 긍정적인 답변을 기대할 수 있습니다.
Can this policy validate answers about whetherhomework submissions are acceptable?
샘플 숙제 정책에서 숙제 제출 지연에 대해 질문하는 경우 Kiro CLI는 정책이 다음 질문에 답할 수 없다고 설명합니다.
Can this policy validate answers aboutpermissible delays in homework submissions?
Kiro CLI는 정책이 수행할 수 있는 작업과 수행할 수 없는 작업을 설명합니다.
> Yes, but with limitations. The policy can validate whether a late submission is acceptable, but it cannot answer general questions about permissible delays.
What it CAN validate:
- Whether a specific late submission is acceptable given the circumstances
- Example: "Student submitted 2 days late with a doctor's note because they were sick before the deadline" → The policy will determine if this is acceptable (it would be)
What it CANNOT validate:
- General questions like "How many days late can a student submit homework?"
- Questions about delay policies without specific submission details
- Hypothetical scenarios without concrete variable values
The late submission logic:
The policy allows late submissions (submissionDate > 0) ONLY if:
1. The student has a valid doctor's note (hasDoctorNote = true), AND
2. The student was sick before the original deadline (wasSickPriorToDeadline = true)
Without both conditions met, any submission after the due date (submissionDate > 0) is automatically rejected.
So it's designed to validate specific submission instances against the rules, not to answer policy interpretation questions.
정책에서 수행할 수 없는 작업을 발견하면 다음 프롬프트를 사용하여이 정보를 캡처하도록 Kiro CLI에 정책을 업데이트하도록 요청할 수 있습니다.
I would like the policy to also validate answers aboutby how many days homework submissions can be delayed. Homework submissions accompanied by a doctor note can be up to 7 days late. Suggest the necessary variables and rules to capture these new questions.
이 프롬프트에 대한 응답으로 Kiro CLI는 새로운 유형의 질문을 검증하기 위해 정책에 추가할 수 있는 변수 및 규칙 세트를 제안합니다. 제안을 검토하고 의도와 일치하는 경우 Kiro CLI에 자동 추론 검사의 주석 APIs를 사용하여 정책을 다음과 같이 변경하도록 지시할 수 있습니다.
Looks good. Can you use the annotation APIs to submit these changes to the policy.
Kiro CLI가 주석이 준비되었음을 확인하면 콘솔에서 정책을 열어 주석을 검토할 수 있습니다. 주석이 올바른 경우 주석 적용을 선택합니다.
참고
자습서 비디오: 주석 검토 및 적용에 대한 step-by-step 연습을 보려면 다음 자습서를 시청하세요.
주석을 적용한 후 Kiro CLI에 정책의 최신 빌드를 다시 로드하도록 요청하여 Kiro CLI가 현재 복사본으로 작업하고 있는지 확인합니다.
I applied the annotations. Reload the latest build of the policy.
실패한 테스트 해결
자동 추론 정책이 애플리케이션에서 생성된 자연어를 검증할 수 있는지 테스트하는 좋은 방법은 테스트를 사용하는 것입니다. 예상 결과와 함께 테스트 Q&A를 생성한 후 Kiro CLI를 사용하여 테스트가 예상 결과를 반환하지 않은 이유를 이해하고 정책을 조정할 수 있습니다. 테스트 생성 및 실행에 대한 자세한 내용은 섹션을 참조하세요자동 추론 정책 테스트.
-
첫 번째 단계로 실패한 테스트를 로드하도록 Kiro CLI에 요청하고 정책 정의를 기반으로 예상 결과를 반환하지 않는 이유를 설명합니다. 콘솔 또는 APIs를 사용하여 실패한 테스트의 테스트 ID를 복사합니다. 콘솔에서 테스트 ID는 테스트를 나열하는 테이블과 각 테스트의 세부 정보 페이지에서 모두 사용할 수 있습니다.
The test with IDYOUR_TEST_IDis not returning the expected result. Can you load the test definition and findings, look at the policy definition, and explain why this test is failing. -
Kiro CLI의 설명은 정책이 올바른 작업을 수행하고 있는지(그리고 테스트에 대한 예상 결과를 변경해야 하는지) 또는 정책이 잘못된지에 대한 지침을 제공합니다. 테스트가 예상 결과를 반환하도록 Kiro CLI에 정책 변경 사항을 제안하도록 요청할 수 있습니다.
Can you suggest changes to the policy to ensure this test returns the expected result? Explain why you are suggesting these changes. Only create rules in if/then format.참고
규칙 변경을 제안할 때 Kiro CLI는 특정 예제에 과적합을 시도하고 다른 사용 사례에서 유용하지 않은 규칙을 만들 수 있습니다. 테스트 출력을 확인하고 올바른 문제에 집중하도록 Kiro CLI 지침을 제공합니다.
예를 들어
SATISFIABLE테스트가를 반환하도록 Kiro에 샘플 홈워크 정책을 변경하도록 요청하면 Kiro는를 나타내는 규칙 생성과 같이 테스트를 항상 통과하도록 하는 정책에 액시옴을 추가할 것을 제안할VALID수 있습니다(false isHomeworkSubmissionAcceptable). 이렇게 하면 값이 항상 false가 됩니다. 이는 기술적으로 문제가 있는 테스트를 수정하지만 전체 정책 기능에는 해롭습니다.SATISFIABLE테스트 결과에서 반환된 시나리오를 분석하면가 Kiro CLI에 테스트에 지정된 제약 조건만 포함하는 새 규칙을 생성하거나 기존 규칙을 업데이트하여 테스트 제약 조건만 확인하도록 더 나은 지침을 제공한다는 것을 알 수 있습니다. -
제안된 변경 사항에 만족하면 Kiro CLI에 주석을 제출하고 콘솔 사용자 인터페이스를 사용하여 검토하도록 요청합니다.
Looks good. Can you start a build workflow to apply these changes to the policy. -
변경 사항을 적용하고 다음 실패 테스트로 이동한 후 Kiro CLI에 정책의 최신 빌드를 다시 로드하도록 요청합니다.
I applied the changes. Reload the latest build of the policy.
다음 단계
자동 추론 정책에 만족하면 Amazon Bedrock Guardrails에서 사용할 수 있도록 배포할 수 있습니다. 자세한 내용은 애플리케이션에 자동 추론 정책 배포 단원을 참조하십시오.
자동 추론 정책 API 컨텍스트 프롬프트
다음 콘텐츠를 복사하여 Kiro CLI용 프로젝트 폴더의 마크다운 파일에 저장합니다. 이 프롬프트는 자동화된 추론 정책 APIs 올바르게 사용하는 데 필요한 컨텍스트를 Kiro CLI에 제공합니다.
# Automated Reasoning Policy APIs and Workflows ## Table of Contents ### Core APIs - Policy Management - Policy Versions - Build Workflows - Test Management - Annotations & Scenarios ### Build Workflow Types - INGEST_CONTENT Workflow - REFINE_POLICY Workflow - IMPORT_POLICY Workflow ### Annotation Type Reference - Type Management Annotations - Variable Management Annotations - Rule Management Annotations - Natural Language Rule Creation - Feedback-Based Updates ### Common Workflows 1. Getting Started (New Policy) 2. Building Policy from Document 3. Policy Development Cycle 4. REFINE_POLICY Workflow (Annotation-Based) ### Testing Workflow 1. Primary Approach: Scenarios API (Recommended) 2. Secondary Approach: Test Cases (User Experience) 3. Test Result Analysis and Troubleshooting ### Build Workflow Monitoring - Check Build Status - List Build History - Best Practice: Clean Build Management - Troubleshooting Build Failures ### Build Workflow Assets - Asset Types - Understanding Conflicting Rules - Understanding Disjoint Rule Sets - Advanced Quality Report Analysis ### Additional Topics - Policy Version Export - Key Concepts - Important Format Requirements - Policy Modeling Best Practices - ARN Formats ## Core APIs ### Policy Management - `create-automated-reasoning-policy` - Create initial policy (returns policy ARN) - `get-automated-reasoning-policy` - Retrieve policy (DRAFT version by default with unversioned ARN) - `update-automated-reasoning-policy` - Update DRAFT policy with new definition - `delete-automated-reasoning-policy` - Delete policy - `list-automated-reasoning-policies` - List all policies ### Policy Versions - `create-automated-reasoning-policy-version` - Snapshot DRAFT into numbered version - `export-automated-reasoning-policy-version` - Export specific policy version ### Build Workflows - `start-automated-reasoning-policy-build-workflow` - Start build process - `get-automated-reasoning-policy-build-workflow` - Get build workflow status - `cancel-automated-reasoning-policy-build-workflow` - Cancel running build - `delete-automated-reasoning-policy-build-workflow` - Delete build workflow - `list-automated-reasoning-policy-build-workflows` - List build workflows - `get-automated-reasoning-policy-build-workflow-result-assets` - Get compiled policy assets ### Test Management - `create-automated-reasoning-policy-test-case` - Create test case - `get-automated-reasoning-policy-test-case` - Get test case details - `update-automated-reasoning-policy-test-case` - Update test case - `delete-automated-reasoning-policy-test-case` - Delete test case - `list-automated-reasoning-policy-test-cases` - List test cases - `start-automated-reasoning-policy-test-workflow` - Run tests - `get-automated-reasoning-policy-test-result` - Get test results - `list-automated-reasoning-policy-test-results` - List test results ### Annotations & Scenarios - `get-automated-reasoning-policy-annotations` - Get policy annotations - `get-automated-reasoning-policy-next-scenario` - Get next test scenario **Important**: Do NOT use `get-automated-reasoning-policy-annotations` or `update-automated-reasoning-policy-annotations` for the `REFINE_POLICY` workflow. Annotations are passed directly in the `start-automated-reasoning-policy-build-workflow` call. ## Build Workflow Types 1. **INGEST_CONTENT** - Process documents to create/extract policy rules 2. **REFINE_POLICY** - Refine and improve existing policies using annotations 3. **IMPORT_POLICY** - Import policies from external sources ### INGEST_CONTENT Workflow - **Purpose**: Extract policy rules from documents (PDF/TXT) - **Input**: Documents + optional existing policy definition - **Use Cases**: Document-to-policy conversion, incremental policy building - **Content Structure**: `workflowContent.documents[]` **CRITICAL: Complete Policy Definition for Incremental Building** When adding documents to an existing policy, you must include the complete current policy definition: ```json // CORRECT - Incremental policy building { "policyDefinition": { "version": "1.0", "types": [/* ALL existing types */], "rules": [/* ALL existing rules */], "variables": [/* ALL existing variables */] }, "workflowContent": { "documents": [/* New documents to process */] } } ``` ### REFINE_POLICY Workflow - **Purpose**: Iteratively improve policies with targeted modifications - **Input**: Policy definition + annotations for specific changes - **Use Cases**: Kiro CLI suggestions, test-driven improvements, feedback-based refinement - **Content Structure**: `workflowContent.policyRepairAssets.annotations[]` **CRITICAL: Complete Policy Definition Required** ALL build workflows require the COMPLETE existing policy definition in the `policyDefinition` section, not just the changes you want to make. **REFINE_POLICY Annotation Types:** **Top-Level Annotations:** - **Type Management**: `addType`, `updateType`, `deleteType` - **Variable Management**: `addVariable`, `updateVariable`, `deleteVariable` - **Rule Management**: `addRule`, `updateRule`, `deleteRule` - **Natural Language Rules**: `addRuleFromNaturalLanguage` - **Feedback-Based Updates**: `updateFromRulesFeedback`, `updateFromScenarioFeedback` **Sub-Operations (only within `updateType`):** - `addTypeValue`, `updateTypeValue`, `deleteTypeValue` - Used to modify values within an existing custom type **important**: Only create rules in if/then format. ## Annotation Type Reference ### Type Management Annotations #### `addType` - Create New Custom Type ```json { "addType": { "name": "ApprovalStatus", "description": "Status values for approval requests", "values": [ { "value": "PENDING", "description": "Request is awaiting approval" }, { "value": "APPROVED", "description": "Request has been approved" }, { "value": "REJECTED", "description": "Request has been rejected" } ] } } ``` #### `updateType` - Modify Existing Custom Type ```json { "updateType": { "name": "ApprovalStatus", "newName": "RequestStatus", "description": "Updated status values for all request types", "values": [ { "addTypeValue": { "value": "ESCALATED", "description": "Request escalated to higher authority" } }, { "updateTypeValue": { "value": "PENDING", "newValue": "WAITING", "description": "Request is waiting for review" } }, { "deleteTypeValue": { "value": "REJECTED" } } ] } } ``` #### `deleteType` - Remove Custom Type ```json { "deleteType": { "name": "ObsoleteType" } } ``` ### Variable Management Annotations #### `addVariable` - Create New Variable ```json { "addVariable": { "name": "requestAmount", "type": "real", "description": "The monetary amount of the approval request in USD" } } ``` #### `updateVariable` - Modify Existing Variable ```json { "updateVariable": { "name": "requestAmount", "newName": "approvalAmount", "description": "The monetary amount requiring approval in USD (updated description)" } } ``` #### `deleteVariable` - Remove Variable ```json { "deleteVariable": { "name": "obsoleteVariable" } } ``` ### Rule Management Annotations #### `addRule` - Create New Rule (SMT-LIB) ```json { "addRule": { "expression": "(=> (and (= userRole MANAGER) (< requestAmount 10000)) (not approvalRequired))" } } ``` #### `updateRule` - Modify Existing Rule ```json { "updateRule": { "ruleId": "A1B2C3D4E5F6", "expression": "(=> (and (= userRole MANAGER) (< requestAmount 5000)) (not approvalRequired))" } } ``` #### `deleteRule` - Remove Rule ```json { "deleteRule": { "ruleId": "G7H8I9J0K1L2" } } ``` ### Natural Language Rule Creation #### `addRuleFromNaturalLanguage` - Convert Natural Language to Rule ```json { "addRuleFromNaturalLanguage": { "naturalLanguage": "Managers can approve expense requests up to $5,000 without additional authorization. Senior managers can approve up to $25,000." } } ``` ### Feedback-Based Updates #### `updateFromRulesFeedback` - Improve Rules Based on Performance ```json { "updateFromRulesFeedback": { "ruleIds": ["A1B2C3D4E5F6", "G7H8I9J0K1L2"], "feedback": "These rules are too restrictive for emergency scenarios. Add exception handling for urgent requests with proper escalation paths." } } ``` #### `updateFromScenarioFeedback` - Improve Based on Test Scenarios ```json { "updateFromScenarioFeedback": { "ruleIds": ["A1B2C3D4E5F6"], "scenarioExpression": "(and (= requestType EMERGENCY) (= userRole MANAGER) (> requestAmount 10000))", "feedback": "Emergency requests should have different approval thresholds. Current rule blocks legitimate emergency expenses." } } ``` **Important**: Do NOT use `get-automated-reasoning-policy-annotations` or `update-automated-reasoning-policy-annotations` for the `REFINE_POLICY` workflow. Annotations are passed directly in the `start-automated-reasoning-policy-build-workflow` call. ## Common Workflows ### 1. Getting Started (New Policy) **CRITICAL: Always Create Policy First** You must create a policy before starting any build workflows. ```bash # Step 1: Create initial policy (REQUIRED FIRST STEP) aws bedrock create-automated-reasoning-policy \ --region us-west-2 \ --name "YourPolicyName" # Step 2: Extract the policyArn from the response above, then start build workflow aws bedrock start-automated-reasoning-policy-build-workflow \ --region us-west-2 \ --policy-arn "arn:aws:bedrock:us-west-2:123456789012:automated-reasoning-policy/abcd1234efgh" \ --build-workflow-type INGEST_CONTENT \ --source-content <policy-definition> # Step 3: Get build results aws bedrock get-automated-reasoning-policy-build-workflow-result-assets \ --region us-west-2 \ --policy-arn "arn:aws:bedrock:us-west-2:123456789012:automated-reasoning-policy/abcd1234efgh" \ --build-workflow-id <workflow-id> ``` ### 2. Building Policy from Document **RECOMMENDED: Using CLI Input JSON File** ```bash # Step 1: Encode PDF to base64 and create JSON file with base64 content PDF_BASE64=$(base64 -i your-policy.pdf | tr -d '\n') cat > ingest-policy.json << EOF { "policyArn": "arn:aws:bedrock:us-west-2:123456789012:automated-reasoning-policy/your-actual-policy-id", "buildWorkflowType": "INGEST_CONTENT", "sourceContent": { "policyDefinition": { "version": "1.0", "types": [], "rules": [], "variables": [] }, "workflowContent": { "documents": [ { "document": "$PDF_BASE64", "documentContentType": "pdf", "documentName": "Company Policy Document", "documentDescription": "Main policy document containing business rules and organizational guidelines." } ] } } } EOF # Step 2: Use the JSON file aws bedrock start-automated-reasoning-policy-build-workflow \ --region us-west-2 \ --cli-input-json file://ingest-policy.json ``` ### 3. Policy Development Cycle ```bash # 1. Import/process policy definition aws bedrock start-automated-reasoning-policy-build-workflow \ --build-workflow-type IMPORT_POLICY # 2. Update DRAFT with processed definition aws bedrock update-automated-reasoning-policy \ --policy-arn <unversioned-arn> \ --policy-definition <build-output> # 3. Create versioned snapshot of DRAFT aws bedrock create-automated-reasoning-policy-version \ --policy-arn <unversioned-arn> ``` ## Testing Workflow ### Primary Approach: Scenarios API (Recommended) Use `get-automated-reasoning-policy-next-scenario` for comprehensive policy validation. The Scenarios API is superior for testing because it: - Tests formal logic directly - Validates policy rules work correctly - AI-generated scenarios - Comprehensive coverage of edge cases and rule interactions - Targets specific rules - Tests individual rules and combinations - Always works - No natural language translation issues - Intelligent test generation - AI understands policy logic deeply ```bash # Generate intelligent test scenarios automatically aws bedrock get-automated-reasoning-policy-next-scenario \ --policy-arn "arn:aws:bedrock:region:account:automated-reasoning-policy/policy-id" \ --build-workflow-id "workflow-123" ``` ### Secondary Approach: Test Cases (User Experience) Use manual test cases to validate natural language translation. ```bash # Create test cases for natural language validation aws bedrock create-automated-reasoning-policy-test-case \ --policy-arn "arn:aws:bedrock:region:account:automated-reasoning-policy/policy-id" \ --guard-content "It is 2:30 PM on a clear day" \ --query-content "What color should the sky be?" \ --expected-aggregated-findings-result "VALID" ``` ### Test Result Analysis and Troubleshooting **Understanding Test Results:** **Scenarios API Results:** - `expectedResult: SATISFIABLE` - Policy logic works correctly - API errors or logic conflicts - Policy needs fixing with REFINE_POLICY **Common Test Case Failure Modes:** 1. **TRANSLATION_AMBIGUOUS** - Problem: AI can't map natural language to policy variables - Solution: Improve variable descriptions with more natural language synonyms 2. **SATISFIABLE when expecting VALID** - Problem: Your expected result label is likely WRONG, not the policy - SATISFIABLE = "This scenario is logically consistent with the policy rules" - VALID = "This is the correct/expected answer according to the policy" - Solution: Change `expectedAggregatedFindingsResult` from `VALID` to `SATISFIABLE` 3. **Empty testFindings arrays** - Problem: Translation issues, not rule violations - Solution: Focus on improving natural language descriptions, not policy logic ## Build Workflow Monitoring **Critical Build Limits**: The API supports maximum 2 total build workflows per policy, with only 1 allowed to be IN_PROGRESS at any time. When a build workflow completes, you can instruct the user to review the output using the console. ### Check Build Status ```bash aws bedrock get-automated-reasoning-policy-build-workflow \ --policy-arn "arn:aws:bedrock:region:account:automated-reasoning-policy/policy-id" \ --build-workflow-id "workflow-123" ``` ### List Build History ```bash aws bedrock list-automated-reasoning-policy-build-workflows \ --policy-arn "arn:aws:bedrock:region:account:automated-reasoning-policy/policy-id" \ --max-results 50 ``` ### Best Practice: Clean Build Management ```bash # 1. Check existing builds before starting new ones aws bedrock list-automated-reasoning-policy-build-workflows \ --policy-arn <policy-arn> \ --max-results 10 # 2. Delete old/completed builds if you have 2 already aws bedrock delete-automated-reasoning-policy-build-workflow \ --policy-arn <policy-arn> \ --build-workflow-id "old-workflow-id" \ --last-updated-at "2025-11-15T00:41:18.608000+00:00" # 3. Now start your new build aws bedrock start-automated-reasoning-policy-build-workflow \ --policy-arn <policy-arn> \ --build-workflow-type INGEST_CONTENT \ --source-content <content> ``` ## Build Workflow Assets After a build workflow completes successfully, you can retrieve various assets. After you complete a build workflow, you can ask the user to check the build diff using the Automated Reasoning checks console. ### Asset Types #### 1. POLICY_DEFINITION - The Main Output ```bash aws bedrock get-automated-reasoning-policy-build-workflow-result-assets \ --policy-arn "arn:aws:bedrock:region:account:automated-reasoning-policy/policy-id" \ --build-workflow-id "workflow-123" \ --asset-type "POLICY_DEFINITION" ``` **What it contains:** - Compiled policy with extracted/refined rules, variables, and types - SMT-LIB expressions for all rules - Complete policy structure ready for deployment #### 2. BUILD_LOG - Build Process Details ```bash aws bedrock get-automated-reasoning-policy-build-workflow-result-assets \ --policy-arn "arn:aws:bedrock:region:account:automated-reasoning-policy/policy-id" \ --build-workflow-id "workflow-123" \ --asset-type "BUILD_LOG" ``` **What it shows:** - Document processing steps - What content was analyzed - Extraction results - What rules, variables, and types were found - Processing warnings - Content that couldn't be interpreted - Success/failure status for each extraction step #### 3. QUALITY_REPORT - Policy Quality Analysis ```bash aws bedrock get-automated-reasoning-policy-build-workflow-result-assets \ --policy-arn "arn:aws:bedrock:region:account:automated-reasoning-policy/policy-id" \ --build-workflow-id "workflow-123" \ --asset-type "QUALITY_REPORT" ``` **What it contains:** - Conflicting rules - Rules that contradict each other - Unused variables - Variables not referenced by any rules - Unused type values - Enum values not used in rules - Disjoint rule sets - Groups of rules that don't interact