{
  "$schema": "https://www.krafthaus.app/schemas/krafthaus-application-manifest-v1.schema.json",
  "schema_version": "krafthaus_application_manifest_v1",
  "application_id": "ai_agent_action_gate",
  "version": "2026-06-14",
  "surface": {
    "workflow": "ai_agent_action_before_execution",
    "purpose": "Gate a proposed AI agent action before autonomous software sends, changes, refunds, updates, or otherwise mutates customer, revenue, or operational state.",
    "owner_role": "ai_ops_or_product_owner",
    "interface_url": "https://www.krafthaus.app/workflow-apps/ai-agent-action"
  },
  "intake": {
    "contract": "closed",
    "fields": [
      {
        "name": "action_id",
        "type": "string",
        "required": true
      },
      {
        "name": "agent_name",
        "type": "string",
        "required": true
      },
      {
        "name": "action_type",
        "type": "string",
        "required": true,
        "enum": [
          "send_customer_message",
          "issue_refund",
          "change_subscription",
          "update_crm",
          "create_ticket"
        ]
      },
      {
        "name": "customer_impact",
        "type": "string",
        "required": true,
        "enum": [
          "internal",
          "external",
          "financial",
          "security"
        ]
      },
      {
        "name": "monetary_value_usd",
        "type": "number",
        "required": true
      },
      {
        "name": "policy_confidence",
        "type": "number",
        "required": true
      },
      {
        "name": "sensitive_data_access",
        "type": "boolean",
        "required": true
      },
      {
        "name": "user_consent_present",
        "type": "boolean",
        "required": true
      },
      {
        "name": "human_approval_present",
        "type": "boolean",
        "required": true
      },
      {
        "name": "reversible",
        "type": "boolean",
        "required": true
      },
      {
        "name": "execution_owner",
        "type": "string",
        "required": true
      }
    ]
  },
  "decide_runtime": {
    "manifest_version": "rulebook_runtime_manifest_v1",
    "manifest_url": "https://api.decide.fyi/manifests/rulebook-runtime-v1.json",
    "rulebook_contract": {
      "schema_version": "rulebook_v1",
      "schema_url": "https://api.decide.fyi/schemas/rulebook-v1.schema.json",
      "schema_hash": "bbf6d40dc8318e4943c6a3955d1ee10c64b63e8a6fdfd53ce33a498d826dfa5c",
      "evaluator_version": "decide_rulebook_v1"
    },
    "execution_model": {
      "production_core": "hybrid_declarative_rulebook_with_trusted_adapters",
      "binding_verdict_selector": "declarative_rulebook",
      "customer_supplied_code": "rejected",
      "trusted_adapters": "registered_fact_producers",
      "response_only_material_policy": {
        "status": "rejected_on_request",
        "applies_to": [
          "request_body",
          "context.inputs",
          "adapter_facts"
        ],
        "fields": [
          "runtime_binding",
          "trusted_adapter",
          "adapter_facts",
          "rulebook_attestation",
          "rulebook_contract",
          "input_hash",
          "decision_id",
          "record_hash",
          "receipt_hash",
          "verify_url",
          "replay_url",
          "engine",
          "evaluator_version",
          "verdict",
          "application_verdict",
          "action",
          "reason_code",
          "matched_rule_id"
        ],
        "error": "RULEBOOK_OUTPUT_MATERIAL_FORBIDDEN"
      },
      "binding_modes": [
        {
          "mode": "direct_declarative_rulebook",
          "status": "supported",
          "request_material": [
            "rulebook",
            "context.inputs"
          ],
          "fact_source": "caller_supplied_inputs",
          "verdict_authority": "declarative_rulebook",
          "customer_supplied_code": "rejected"
        },
        {
          "mode": "trusted_adapter_facts_then_declarative_rulebook",
          "status": "supported",
          "request_material": [
            "adapter",
            "rulebook"
          ],
          "fact_source": "registered_first_party_adapter",
          "adapter_authority": "facts_only",
          "verdict_authority": "declarative_rulebook",
          "customer_supplied_code": "rejected"
        }
      ],
      "unsupported_modes": [
        {
          "mode": "customer_executable_rulebook",
          "status": "rejected",
          "reason": "Rulebook v1 is closed declarative JSON; executable policy logic requires a future versioned contract."
        }
      ]
    },
    "conformance": {
      "index_url": "https://api.decide.fyi/conformance/rulebook-v1/index.json",
      "version": "rulebook_v1_conformance_v1"
    },
    "replay": {
      "index_url": "https://api.decide.fyi/replay/rulebook-v1/index.json",
      "corpus_version": "rulebook_v1_golden_replay_v1",
      "contract": "historical_rulebook_replay_v1"
    },
    "application_binding": {
      "contract_version": "decide_application_binding_v1",
      "applies_to": "krafthaus_workflow_applications",
      "must_bind_before_action": true,
      "accepted_fact_sources": [
        "context.inputs",
        "adapter_facts"
      ],
      "required_decision_material": [
        "rulebook_contract",
        "runtime_binding",
        "verdict",
        "application_verdict",
        "action",
        "reason_code",
        "matched_rule_id",
        "rulebook.hash",
        "input_hash",
        "rulebook_attestation.bundle_hash"
      ],
      "replay_reference": "https://api.decide.fyi/replay/rulebook-v1/index.json",
      "conformance_reference": "https://api.decide.fyi/conformance/rulebook-v1/index.json",
      "prohibited_claims": [
        "llm_output_is_binding_production_verdict",
        "customer_executable_code_runs_as_rulebook_v1",
        "action_executes_before_decision_material_is_captured"
      ]
    }
  },
  "rulebook_binding": {
    "mode": "direct_declarative_rulebook",
    "rulebook_id": "ai_agent_action_gate",
    "rulebook_version": "2026-06-14",
    "rulebook_hash": "ffd945af92f5c68c2ea7f0630af7f7de4c785d84455acc9fada61499e6ec3892",
    "customer_supplied_code": "rejected"
  },
  "record_contract": {
    "required": true,
    "required_fields": [
      "decision_id",
      "request_id",
      "action_id",
      "agent_name",
      "execution_owner",
      "record_hash",
      "receipt_hash",
      "verify_url",
      "replay_url",
      "rulebook",
      "rulebook_contract",
      "runtime_binding",
      "application_verdict",
      "input_hash",
      "rulebook_attestation.bundle_hash"
    ],
    "verification_required": true,
    "replay_required": true
  },
  "action_boundary": {
    "proposed_action": "execute_ai_agent_action",
    "target_system": "ai_agent_runtime",
    "mutation": "agent.execute_action",
    "allow_verdicts": [
      "ALLOW_ACTION"
    ],
    "review_verdicts": [
      "ROUTE_REVIEW"
    ],
    "block_verdicts": [
      "BLOCK_ACTION"
    ],
    "fail_closed": true
  },
  "handoff": {
    "by_verdict": {
      "ALLOW_ACTION": "execute_agent_action",
      "ROUTE_REVIEW": "route_to_human_review",
      "BLOCK_ACTION": "block_agent_action"
    },
    "decision_record_required": true,
    "execution_receipt_required": true,
    "artifact": "ai_agent_action_decision_record_and_execution_handoff"
  },
  "outcome_path": {
    "execution_receipt": "required_when_agent_action_executes",
    "outcome_record": "recommended_after_action_result",
    "material_change": "new_ai_agent_action_decision_required"
  }
}
