自動推論ポリシーで Kiro CLI を使用する - Amazon Bedrock

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

自動推論ポリシーで Kiro CLI を使用する

Kiro CLI を使用して、Automated Reasoning ポリシーについて質問したり、さまざまなルールの動作を理解したり、失敗したテストやポリシー自体のあいまいさに対処する変更をリクエストしたりできます。

前提条件

自動推論ポリシーで Kiro CLI を使用するには、まず次のステップを完了する必要があります。

  • Kiro CLI の最新バージョンをインストールします。

  • AWS CLI の最新バージョンをインストールします。

  • コンソールまたは APIs を使用してドキュメントを使用して自動推論ポリシーを作成します。すぐに開始するには、コンソールから組み込みのサンプルホームワークポリシーを使用します。詳細については、「自動推論ポリシーを作成する」を参照してください。

  • で提供されたコンテキストプロンプトの内容をコピー自動推論ポリシー API コンテキストプロンプトし、プロジェクトフォルダの Markdown ファイルに保存します。このプロンプトは、Kiro CLI が自動推論ポリシーコントロールプレーンを使用して API を正しくテストするのに役立ちます。

注記

以下のプロンプト例では、サンプルホームワークポリシーを使用します。プロンプトは他のポリシーと同様に機能します。強調表示されたトピックを変更するだけです。

注記

自動推論ポリシーは複雑になる場合があり、Kiro CLI は複雑な論理構造を通じて推論する必要があります。最高のパフォーマンスを得るには、Anthropic Sonnet 4.5 などのより大きな LLMs を使用することをお勧めします。Kiro CLI でモデルを変更するには、 /model コマンドを使用します。

開始方法

Kiro CLI でワークフローを開始するには、作成した自動推論ポリシーの ARN が必要です。

  1. コンソールを使用して自動推論ポリシーを開き、ポリシーの概要ページからポリシーの詳細タブを開きます。

  2. ポリシーの詳細タブで、ポリシー ARN を見つけてクリップボードにコピーします。

  3. ターミナルを使用して、次のコマンドを使用して Kiro CLI セッションを開始します。

    kiro-cli
  4. 最初のプロンプトで、前提条件の一部としてこのページからコピーした Markdown ファイルを検索するように Kiro に依頼します。例えば、次のようになります。

    We will be using Automated Reasoning checks control plane APIs. I have saved an instructions file called your_file_name.md in this folder. Read this file as it will give you the context you need to work with the APIs.
  5. Kiro CLI が自動推論チェックの APIs をロードして理解したら、ポリシーの最新ビルドをロードして探索を開始するように依頼します。コピーした ARN で、次のプロンプトのバリエーションを使用します。

    Load the policy assets for the latest build of the policy with ARN YOUR_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 コンソールのユーザーインターフェイスを使用して、差分画面で提案された変更を確認できます。コンソールを使用して変更を確認して承認する場合は、ポリシー定義の最新ビルドを再ロードするように Kiro CLI に指示することを忘れないでください。

ポリシーの操作

Kiro CLI を使用してポリシーを調べることができます。たとえば、特定の領域に関連するポリシールールを要約するように Kiro CLI に依頼できます。サンプル宿題ポリシーを例として使用して、数学の宿題を特に制約するルールについて Kiro CLI に指示してもらうことができます。

Can you tell me about the rules that constrain math 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 whether homework submissions are acceptable?

サンプルホームワークポリシーで宿題提出の遅延について質問した場合、Kiro CLI はポリシーが以下の質問に答えることができないことを説明しています。

Can this policy validate answers about permissible 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 about by 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 は、新しいタイプの質問を検証するためにポリシーに追加できる一連の変数とルールを提案します。提案を確認し、インテントと一致している場合は、自動推論チェックの注釈 APIs を使用してポリシーにこれらの変更を加えるように Kiro CLI に指示できます。

Looks good. Can you use the annotation APIs to submit these changes to the policy.

Kiro CLI が注釈の準備が整ったことを確認したら、コンソールでポリシーを開いて注釈を確認できます。注釈が正しい場合は、注釈の適用を選択します。

注記

チュートリアルビデオ: 注釈を確認して適用するstep-by-stepのチュートリアルについては、次のチュートリアルをご覧ください。

チュートリアルデモ 3 - 自動推論ポリシーの改良

注釈を適用したら、Kiro CLI にポリシーの最新ビルドを再ロードするように依頼して、Kiro CLI が現在のコピーで動作していることを確認します。

I applied the annotations. Reload the latest build of the policy.

テストの失敗に対処する

自動推論ポリシーがアプリケーションによって生成された自然言語を検証できることをテストする良い方法は、テストを使用することです。期待される結果を含むテスト Q&A を作成したら、Kiro CLI を使用して、テストが期待される結果を返さなかった理由を理解し、ポリシーを調整できます。テストの作成と実行の詳細については、「」を参照してください自動推論ポリシーをテストする

  1. 最初のステップとして、失敗したテストをロードし、ポリシー定義に基づいて期待される結果を返さない理由を説明するように Kiro CLI に依頼します。コンソールまたは APIs を使用して、失敗したテストのテスト ID をコピーします。コンソールでは、テスト ID は、テストを一覧表示する表と、各テストの詳細ページの両方で使用できます。

    The test with ID YOUR_TEST_ID is 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.
  2. 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 に依頼するとVALID、Kiro は、 というルールを作成するなど、テストを常に合格にするポリシーにアキシオムを追加することを提案することがあります(false isHomeworkSubmissionAcceptable)。これにより、値は常に false になります。これにより技術的に問題のあるテストが修正されますが、ポリシーの全体的な機能に悪影響を及ぼします。SATISFIABLE テスト結果から返されるシナリオを分析すると、Kiro CLI に、テストで指定された制約のみを対象とする新しいルールを作成するか、既存のルールを更新してテスト制約のみを確認するというより適切なガイダンスが与えられることがわかります。

  3. 提案された変更に満足したら、Kiro CLI に注釈を送信してコンソールのユーザーインターフェイスを使用して確認するよう依頼します。

    Looks good. Can you start a build workflow to apply these changes to the policy.
  4. 変更を適用し、次のテストに合格したら、ポリシーの最新ビルドを再ロードするよう Kiro CLI に依頼します。

    I applied the changes. Reload the latest build of the policy.

次の手順

自動推論ポリシーに満足したら、Amazon Bedrock ガードレールで使用できるようにデプロイできます。詳細については、「自動推論ポリシーをアプリケーションでデプロイする」を参照してください。

自動推論ポリシー API コンテキストプロンプト

次のコンテンツをコピーし、Kiro CLI のプロジェクトフォルダの Markdown ファイルに保存します。このプロンプトは、自動推論ポリシー 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