Decision Gate Docs

Deterministic, replayable gate evaluation with auditable decisions.

Asset Core docs

Example Artifacts

These examples are generated from the canonical contract and used throughout the guides.

Download: examples/decision-gate.toml (1.1 KB) Download: examples/run-config.json (220 B) Download: examples/scenario.json (1.6 KB) Download: examples/scenario.ron (2.1 KB)

decision-gate.toml

[server]
transport = "stdio"
mode = "strict"
max_body_bytes = 1048576

[namespace]
allow_default = false

[trust]
default_policy = "audit"
min_lane = "verified"

[evidence]
allow_raw_values = false
require_provider_opt_in = true

[policy]
engine = "permit_all"

[runpack_storage]
type = "object_store"
provider = "s3"
bucket = "decision-gate-runpacks"
prefix = "decision-gate/runpacks"
# endpoint = "https://s3.example.com"
# force_path_style = false
# allow_http = false

[run_state_store]
type = "sqlite"
path = "decision-gate.db"
journal_mode = "wal"
sync_mode = "full"
busy_timeout_ms = 5000
max_versions = 1000

[[providers]]
name = "time"
type = "builtin"

[[providers]]
name = "env"
type = "builtin"

[[providers]]
name = "json"
type = "builtin"
config = { root = "./evidence", root_id = "evidence-root", max_bytes = 1048576, allow_yaml = true }

[[providers]]
name = "http"
type = "builtin"
config = { allow_http = false, timeout_ms = 5000, max_response_bytes = 1048576, allowed_hosts = ["api.example.com"], user_agent = "decision-gate/0.1", hash_algorithm = "sha256" }

run-config.json

{
  "dispatch_targets": [
    {
      "agent_id": "agent-alpha",
      "kind": "agent"
    }
  ],
  "namespace_id": 1,
  "policy_tags": [],
  "run_id": "run-0001",
  "scenario_id": "example-scenario",
  "tenant_id": 1
}

scenario.json

{
  "conditions": [
    {
      "comparator": "equals",
      "condition_id": "env_is_prod",
      "expected": "production",
      "policy_tags": [],
      "query": {
        "check_id": "get",
        "params": {
          "key": "DEPLOY_ENV"
        },
        "provider_id": "env"
      }
    },
    {
      "comparator": "equals",
      "condition_id": "after_freeze",
      "expected": true,
      "policy_tags": [],
      "query": {
        "check_id": "after",
        "params": {
          "timestamp": 1710000000000
        },
        "provider_id": "time"
      }
    }
  ],
  "default_tenant_id": null,
  "namespace_id": 1,
  "policies": [],
  "scenario_id": "example-scenario",
  "schemas": [],
  "spec_version": "v1",
  "stages": [
    {
      "advance_to": {
        "kind": "terminal"
      },
      "entry_packets": [
        {
          "content_type": "application/json",
          "expiry": null,
          "packet_id": "packet-hello",
          "payload": {
            "kind": "json",
            "value": {
              "message": "hello",
              "purpose": "scenario entry packet"
            }
          },
          "policy_tags": [],
          "schema_id": "schema-hello",
          "visibility_labels": [
            "public"
          ]
        }
      ],
      "gates": [
        {
          "gate_id": "env_gate",
          "requirement": {
            "Condition": "env_is_prod"
          }
        },
        {
          "gate_id": "time_gate",
          "requirement": {
            "Condition": "after_freeze"
          }
        }
      ],
      "on_timeout": "fail",
      "stage_id": "main",
      "timeout": null
    }
  ]
}

scenario.ron

{
    "conditions": [
        {
            "comparator": "equals",
            "condition_id": "env_is_prod",
            "expected": "production",
            "policy_tags": [],
            "query": {
                "check_id": "get",
                "params": {
                    "key": "DEPLOY_ENV",
                },
                "provider_id": "env",
            },
        },
        {
            "comparator": "equals",
            "condition_id": "after_freeze",
            "expected": true,
            "policy_tags": [],
            "query": {
                "check_id": "after",
                "params": {
                    "timestamp": 1710000000000,
                },
                "provider_id": "time",
            },
        },
    ],
    "default_tenant_id": (),
    "namespace_id": 1,
    "policies": [],
    "scenario_id": "example-scenario",
    "schemas": [],
    "spec_version": "v1",
    "stages": [
        {
            "advance_to": {
                "kind": "terminal",
            },
            "entry_packets": [
                {
                    "content_type": "application/json",
                    "expiry": (),
                    "packet_id": "packet-hello",
                    "payload": {
                        "kind": "json",
                        "value": {"message": "hello", "purpose": "scenario entry packet"},
                    },
                    "policy_tags": [],
                    "schema_id": "schema-hello",
                    "visibility_labels": [
                        "public",
                    ],
                },
            ],
            "gates": [
                {
                    "gate_id": "env_gate",
                    "requirement": {
                        "Condition": "env_is_prod",
                    },
                },
                {
                    "gate_id": "time_gate",
                    "requirement": {
                        "Condition": "after_freeze",
                    },
                },
            ],
            "on_timeout": "fail",
            "stage_id": "main",
            "timeout": (),
        },
    ],
}