Utilice la CLI de Kiro con una política de razonamiento automatizado - Amazon Bedrock

Las traducciones son generadas a través de traducción automática. En caso de conflicto entre la traducción y la version original de inglés, prevalecerá la version en inglés.

Utilice la CLI de Kiro con una política de razonamiento automatizado

Puede usar la CLI de Kiro para hacer preguntas sobre sus políticas de razonamiento automatizado, comprender el comportamiento de las distintas reglas y solicitar cambios que aborden las pruebas fallidas o las ambigüedades de la propia política.

Requisitos previos

Para utilizar la CLI de Kiro con sus políticas de razonamiento automatizado, primero debe completar los siguientes pasos:

  • Instale la última versión de Kiro CLI.

  • Instale la versión más reciente de AWS CLI.

  • Cree una política de razonamiento automatizado utilizando un documento a través de la consola o APIs. Para empezar rápidamente, utiliza el ejemplo de política de tareas integrado de la consola. Para obtener más información, consulte Creación de una política de razonamiento automatizado.

  • Copie el contenido del mensaje contextual incluido Política de razonamiento automatizado, indicador de contexto de la API y guárdelo en un archivo Markdown en la carpeta de su proyecto. Este mensaje ayuda a Kiro CLI a utilizar el plano de control de políticas de razonamiento automatizado y a probar la API correctamente.

nota

Para los ejemplos de instrucciones que aparecen a continuación, utilizamos el ejemplo de política de tareas escolares. Las instrucciones deberían funcionar igual de bien con otras políticas, basta con cambiar el tema resaltado.

nota

Las políticas de razonamiento automatizado pueden ser complejas y requieren que la CLI de Kiro razone mediante construcciones lógicas complejas. Para obtener el mejor rendimiento, recomendamos utilizar modelos más grandes, LLMs como Anthropic Sonnet 4.5. Para cambiar el modelo en la CLI de Kiro, utilice el /model comando.

Introducción

Necesita el ARN de la política de razonamiento automatizado que creó para iniciar el flujo de trabajo con Kiro CLI.

  1. Con la consola, abra su política de razonamiento automatizado y, en la página de descripción general de la política, abra la pestaña de detalles de la política.

  2. En la pestaña Detalles de la política, busca el ARN de la política y cópialo en el portapapeles.

  3. Desde el terminal, inicie una sesión CLI de Kiro con el siguiente comando:

    kiro-cli
  4. Cuando se le pida por primera vez, pida a Kiro que busque las instrucciones del archivo Markdown que ha copiado de esta página como parte de los requisitos previos. Por ejemplo:

    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. Una vez que Kiro CLI haya cargado y comprendido las «comprobaciones de razonamiento automatizadas» APIs, pídale que cargue la versión más reciente de su política y comience a explorarla. Utilice una variante de la siguiente solicitud con el ARN que ha copiado:

    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.

En este punto, la CLI de Kiro debería proporcionarle una breve descripción de las reglas y variables de la política. La CLI de Kiro también debería cargar el informe de calidad de la política y resumir cuestiones como los tipos y variables no utilizados.

Resolver problemas de política

Puede utilizar la CLI de Kiro para resolver los problemas de política informados en el informe de políticas. En primer lugar, pida a Kiro que le dé un resumen del informe de calidad:

Can you give me a summary of the quality report for this policy?

El informe de calidad incluye una lista de las variables no utilizadas, las normas contradictorias y las normas inconexas, así como otros posibles problemas relacionados con la política.

Las reglas contradictorias harán que su política responda a todas las solicitudes de validaciónIMPOSSIBLE. Puede pedirle a Kiro CLI que explique el conflicto y proponga una solución:

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?

Las variables no utilizadas pueden provocar que el resultado de la validación devuelva TRANSLATION_AMBIGUOUS resultados. Puede pedir ayuda a Kiro CLI con este problema:

I see the quality report lists some unused variables, can you get rid of them?

Del mismo modo, las variables ambiguas que son semánticamente similares pueden provocar que el resultado de la validación devuelva TRANSLATION_AMBIGUOUS resultados. Puede pedir ayuda a Kiro CLI con este problema:

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.
nota

Tras procesar algunos cambios, Kiro CLI solicitará confirmación para aplicarlos. En este punto, puede utilizar la interfaz de usuario de Bedrock Console para revisar los cambios propuestos en una pantalla de diferencias. Si utiliza la consola para revisar y aprobar los cambios, no olvide decirle a Kiro CLI que vuelva a cargar la última versión de la definición de política.

Interactuar con una política

Puede utilizar la CLI de Kiro para explorar su política. Por ejemplo, puede pedirle a Kiro CLI que resuma las reglas de política relacionadas con un área específica. Utilizando el ejemplo de la política de tareas escolares como ejemplo, puedes pedirle a Kiro CLI que te informe sobre las reglas que limitan específicamente los deberes de matemáticas:

Can you tell me about the rules that constrain math homework? Explain the rules themselves and how they fit in the broader policy.

También puede utilizar la CLI de Kiro para añadir funciones a la política. Las políticas de razonamiento automatizado suelen basarse en algunas variables de salida clave que captan la intención del usuario. Por ejemplo, el ejemplo de política de envío de tareas utiliza una isSubmissionAcceptable variable como resultado de sus reglas. Puede utilizar la CLI de Kiro para modificar la política y captar otras posibles preguntas de los usuarios.

¿Editar o revisar su política

Puede preguntar a Kiro CLI si la política es capaz de validar preguntas específicas de sus usuarios. Por ejemplo, la política de tareas se centra en determinar si la presentación de una tarea es aceptable. Puede esperar una respuesta positiva de Kiro CLI con esta pregunta:

Can this policy validate answers about whether homework submissions are acceptable?

Si pregunta sobre el retraso en la presentación de los deberes en el ejemplo de política de tareas, Kiro CLI le explicará que la política no es capaz de responder a estas preguntas:

Can this policy validate answers about permissible delays in homework submissions?

Kiro CLI explicará lo que la política puede y no puede hacer:

> 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.
    

Cuando descubra algo que la política no puede hacer, puede solicitar a Kiro CLI que actualice la política para recopilar esta información mediante el siguiente mensaje:

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.

En respuesta a esta solicitud, la CLI de Kiro sugerirá un conjunto de variables y reglas que se pueden añadir a la política para validar el nuevo tipo de preguntas. Revise las sugerencias y, si se ajustan a su intención, puede indicarle a Kiro CLI que utilice la anotación de las comprobaciones de razonamiento automatizadas APIs para realizar estos cambios en la política:

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

Una vez que la CLI de Kiro confirme que las anotaciones están listas, puede abrir su política en la consola para revisarlas. Si las anotaciones son correctas, elija Aplicar anotaciones.

nota

Vídeo tutorial: para ver un step-by-step tutorial sobre cómo revisar y aplicar las anotaciones, consulte el siguiente tutorial:

Demostración del tutorial 3: Ajuste de la política de razonamiento automatizado

Tras aplicar las anotaciones, pida a Kiro CLI que vuelva a cargar la última versión de la política para asegurarse de que Kiro CLI funcione con una copia actual:

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

Solucione las pruebas fallidas

Una buena forma de comprobar que tu política de razonamiento automatizado puede validar el lenguaje natural generado por tu aplicación es utilizar pruebas. Tras crear las preguntas y respuestas de las pruebas con los resultados esperados, puede utilizar la CLI de Kiro para entender por qué una prueba no arrojó el resultado esperado y ajustar la política. Para obtener más información sobre la creación y ejecución de pruebas, consulte. Prueba de una política de razonamiento automatizado

  1. Como primer paso, pida a Kiro CLI que cargue la prueba fallida y explique por qué no devuelve el resultado esperado según la definición de la política. Utilice la consola o APIs copie el identificador de la prueba que no ha superado. En la consola, el identificador de la prueba está disponible tanto en la tabla que muestra las pruebas como en la página de detalles de cada prueba.

    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. La explicación de Kiro CLI le indicará si la política funciona correctamente (y debe cambiar el resultado esperado de la prueba) o si la política es incorrecta. Puede pedirle a Kiro CLI que sugiera cambios en la política para garantizar que la prueba arroje el resultado esperado:

    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.
    nota

    Al sugerir cambios en las reglas, la CLI de Kiro puede intentar sobreajustarse al ejemplo específico y crear reglas que no sean útiles en otros casos de uso. Compruebe el resultado de la prueba y guíe a Kiro CLI para centrarlo en el problema correcto.

    Por ejemplo, si le pides a Kiro que modifique el modelo de política de deberes para que el SATISFIABLE examen sea VALID exitoso, puede que Kiro sugiera añadir axiomas a la política que hagan que el examen siempre se apruebe, por ejemplo, crear una regla que diga: (false isHomeworkSubmissionAcceptable) Esto garantizaría que el valor siempre sea falso. Si bien esto soluciona técnicamente la prueba problemática, va en detrimento de la funcionalidad general de la política. Al analizar los escenarios devueltos por el resultado de la SATISFIABLE prueba, puede ver que le dan a Kiro CLI una mejor orientación para crear una nueva regla que solo cubra las restricciones especificadas en la prueba o actualizar las reglas existentes para comprobar únicamente las restricciones de la prueba:

  3. Cuando esté satisfecho con los cambios sugeridos, pida a Kiro CLI que envíe las anotaciones y las revise mediante la interfaz de usuario de la consola:

    Looks good. Can you start a build workflow to apply these changes to the policy.
  4. Tras aplicar los cambios y pasar a la siguiente prueba fallida, pida a Kiro CLI que vuelva a cargar la última versión de la política:

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

Siguientes pasos

Una vez que esté satisfecho con la política de razonamiento automatizado, podrá implementarla para utilizarla en Amazon Bedrock Guardrails. Para obtener más información, consulte Implementación de la política de razonamiento automatizado en su aplicación.

Política de razonamiento automatizado, indicador de contexto de la API

Copie el siguiente contenido y guárdelo en un archivo Markdown en la carpeta de su proyecto para Kiro CLI. Este mensaje proporciona a Kiro CLI el contexto que necesita para funcionar APIs correctamente con la política de razonamiento automatizado.

# 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