Chio/Docs

Policy Schema Reference

Complete reference for the HushSpec policy schema. Policies are YAML documents that configure the Chio kernel's guard pipeline, extensions, and governance metadata.

Top-Level Fields

FieldTypeRequiredDescription
hushspecstringyesSchema version. Currently "0.1.0"
namestringnoHuman-readable policy name
descriptionstringnoHuman-readable description of the policy's purpose
extendsstringnoBase policy to inherit from (path or identifier)
merge_strategyenumnoHow to merge with the base policy: replace, merge, or deep_merge (default: deep_merge)
rulesobjectnoGuard rule configuration (see below)
extensionsobjectnoExtension configuration: posture, origins, detection, reputation, runtime_assurance
metadataobjectnoGovernance metadata (author, approval, classification, lifecycle)
minimal-policy.yaml
hushspec: "0.1.0"
name: my-policy
description: A minimal example policy

rules:
  tool_access:
    enabled: true
    default: block
    allow:
      - read_file

Rules

The rules block configures each guard in the kernel's guard pipeline. All rules are optional. Guards whose rule is omitted are disabled and return allow by default.

forbidden_paths

Blocks access to file paths matching glob patterns. Matched paths are denied regardless of other rules.

FieldTypeDefaultDescription
enabledbooltrueWhether this guard is active
patternsstring[][]Glob patterns to block (e.g. **/.env, **/*.pem)
exceptionsstring[][]Glob patterns exempted from blocking
yaml
rules:
  forbidden_paths:
    enabled: true
    patterns:
      - "**/.env"
      - "**/*.pem"
      - "**/credentials*"
    exceptions:
      - "**/credentials.example.json"

path_allowlist

Restricts file access to explicitly declared directory roots with read/write/patch granularity.

FieldTypeDefaultDescription
enabledboolfalseWhether this guard is active
readstring[][]Glob patterns for read-allowed paths
writestring[][]Glob patterns for write-allowed paths
patchstring[][]Glob patterns for patch-allowed paths
yaml
rules:
  path_allowlist:
    enabled: true
    read:
      - ./workspace/**
      - ./docs/**
    write:
      - ./workspace/output/**
    patch:
      - ./workspace/src/**

egress

Controls outbound network access by domain. The default action applies to domains not in either list.

FieldTypeDefaultDescription
enabledbooltrueWhether this guard is active
allowstring[][]Domains to allow (e.g. api.example.com)
blockstring[][]Domains to block
defaultenumblockDefault action for unlisted domains: allow or block
yaml
rules:
  egress:
    enabled: true
    default: block
    allow:
      - api.github.com
      - registry.npmjs.org
    block:
      - evil.example.com

secret_patterns

Scans tool arguments and results for secrets using regex patterns. Matches trigger a deny with the matching pattern's severity level.

FieldTypeDefaultDescription
enabledbooltrueWhether this guard is active
patternsSecretPattern[][]Array of secret pattern definitions
skip_pathsstring[][]File paths to skip during scanning

Each SecretPattern has the following fields:

FieldTypeRequiredDescription
namestringyesIdentifier for this pattern
patternstring (regex)yesRegular expression to match
severityenumyescritical, error, or warn
descriptionstringnoHuman-readable description of what this pattern detects
yaml
rules:
  secret_patterns:
    enabled: true
    patterns:
      - name: aws_key
        pattern: "AKIA[0-9A-Z]{16}"
        severity: critical
        description: AWS access key ID
      - name: github_token
        pattern: "ghp_[a-zA-Z0-9]{36}"
        severity: critical
    skip_paths:
      - "**/test/fixtures/**"

patch_integrity

Validates that file patches (diffs) stay within configured size and balance bounds.

FieldTypeDefaultDescription
enabledbooltrueWhether this guard is active
max_additionsinteger1000Maximum number of added lines per patch
max_deletionsinteger500Maximum number of deleted lines per patch
forbidden_patternsstring[][]Regex patterns forbidden in patch content
require_balanceboolfalseRequire additions and deletions to be roughly balanced
max_imbalance_ratiofloat10.0Maximum ratio of additions to deletions (or vice versa) when balance is required
yaml
rules:
  patch_integrity:
    enabled: true
    max_additions: 500
    max_deletions: 200
    require_balance: true
    max_imbalance_ratio: 5.0
    forbidden_patterns:
      - "eval\\("
      - "exec\\("

shell_commands

Controls which shell command patterns are allowed or blocked.

FieldTypeDefaultDescription
enabledbooltrueWhether this guard is active
forbidden_patternsstring[][]Regex patterns that trigger a deny when matched
yaml
rules:
  shell_commands:
    enabled: true
    forbidden_patterns:
      - "rm\\s+-rf"
      - "curl.*\\|.*sh"
      - "chmod\\s+777"

tool_access

Controls which tools can be invoked and optionally requires confirmation or specific runtime assurance tiers.

FieldTypeDefaultDescription
enabledbooltrueWhether this guard is active
allowstring[][]Tool names to allow
blockstring[][]Tool names to block
require_confirmationstring[][]Tool names that require explicit confirmation
defaultenumallowDefault action for unlisted tools: allow or block
max_args_sizeintegernoneMaximum byte size of tool arguments
require_runtime_assurance_tierenumnoneHard requirement: none, basic, attested, verified
prefer_runtime_assurance_tierenumnoneSoft preference for runtime assurance tier
require_workload_identityWorkloadIdentityMatchnoneHard requirement for workload identity matching
prefer_workload_identityWorkloadIdentityMatchnoneSoft preference for workload identity matching

WorkloadIdentityMatch

The require_workload_identity and prefer_workload_identity fields accept an object with: scheme (spiffe), trust_domain (string), path_prefixes (string[]), and credential_kinds (uri, x509_svid, jwt_svid). See Workload Identity for the normalized shape and Bind Workload Identity for the operational recipe.
yaml
rules:
  tool_access:
    enabled: true
    default: block
    allow:
      - read_file
      - list_directory
      - search_files
    block:
      - delete_file
    require_confirmation:
      - write_file
    max_args_size: 65536
    require_runtime_assurance_tier: attested

computer_use

Controls computer-use actions such as mouse clicks, keyboard input, and screen capture.

FieldTypeDefaultDescription
enabledboolfalseWhether this guard is active
modeenumguardrailobserve (log only), guardrail (enforce with fallback), or fail_closed (strict deny)
allowed_actionsstring[][]Specific computer-use actions to allow

remote_desktop_channels

Controls which RDP/VNC side-channels are permitted during remote desktop sessions.

FieldTypeDefaultDescription
enabledboolfalseWhether this guard is active
clipboardboolfalseAllow clipboard sharing
file_transferboolfalseAllow file transfer
audiobooltrueAllow audio channel
drive_mappingboolfalseAllow drive mapping

input_injection

Controls synthetic input injection during computer-use sessions.

FieldTypeDefaultDescription
enabledboolfalseWhether this guard is active
allowed_typesstring[][]Input types to allow (e.g. keyboard, mouse)
require_postcondition_probeboolfalseRequire a postcondition verification probe after injection

Extensions

Extensions add advanced capabilities beyond the core guard pipeline: stateful posture management, origin-aware policies, detection integrations, reputation scoring, and runtime attestation assurance.

posture

Defines a state machine for adaptive security postures. The kernel transitions between states based on agent behavior, enabling progressive trust escalation or de-escalation.

FieldTypeDescription
initialstringName of the starting state
statesmap<string, PostureState>Named states with capabilities and budgets
transitionsPostureTransition[]Rules for moving between states

Transition triggers: user_approval, user_denial, critical_violation, any_violation, timeout, budget_exhausted, pattern_match.

yaml
extensions:
  posture:
    initial: restricted
    states:
      restricted:
        description: Limited tool access
        capabilities: [read_file]
        budgets:
          tool_calls: 50
      standard:
        description: Normal operating mode
        capabilities: [read_file, write_file, search_files]
        budgets:
          tool_calls: 500
    transitions:
      - from: restricted
        to: standard
        on: user_approval
      - from: standard
        to: restricted
        on: critical_violation

origins

Origin-aware policy profiles that match requests based on provider, tenant, organization, space, and other contextual attributes.

FieldTypeDefaultDescription
default_behaviorenumdenydeny or minimal_profile for unmatched origins
profilesOriginProfile[][]Array of origin profile definitions

Each profile can specify match rules (provider, tenant_id, organization_id, space_id, space_type, visibility, external_participants, tags, groups, roles, sensitivity, actor_role), along with per-origin overrides for posture, tool_access, egress, data policy, budgets, and bridge configuration.

yaml
extensions:
  origins:
    default_behavior: deny
    profiles:
      - name: internal-prod
        match:
          provider: google-workspace
          tenant_id: acme-corp
          sensitivity: confidential
        overrides:
          tool_access:
            default: allow
          egress:
            default: block
            allow: [api.github.com]
      - name: external-partner
        match:
          external_participants: true
        overrides:
          tool_access:
            default: block
            allow: [read_file]

detection

Integrates with detection engines for prompt injection, jailbreak attempts, and threat intelligence.

Sub-fieldOptionsDescription
prompt_injectionenabled, warn_at_or_above, block_at_or_above, max_scan_bytesPrompt injection detection with configurable severity thresholds
jailbreakenabled, block_threshold, warn_threshold, max_input_bytesJailbreak attempt detection
threat_intelenabled, pattern_db, similarity_threshold, top_kThreat intelligence pattern matching

Detection levels for prompt injection: safe, suspicious, high, critical.

yaml
extensions:
  detection:
    prompt_injection:
      enabled: true
      warn_at_or_above: suspicious
      block_at_or_above: high
      max_scan_bytes: 65536
    jailbreak:
      enabled: true
      warn_threshold: 0.6
      block_threshold: 0.85
      max_input_bytes: 32768
    threat_intel:
      enabled: true
      pattern_db: ./data/threat-intel.json
      similarity_threshold: 0.82
      top_k: 5

reputation

Configures the reputation scoring system with weighted metrics, temporal decay, and tiered access control.

yaml
extensions:
  reputation:
    scoring:
      weights:
        boundary_pressure: 0.15
        resource_stewardship: 0.15
        least_privilege: 0.15
        history_depth: 0.10
        tool_diversity: 0.10
        delegation_hygiene: 0.10
        reliability: 0.15
        incident_correlation: 0.10
      temporal_decay_half_life_days: 30
      probationary_receipt_count: 100
      probationary_score_ceiling: 0.6
      probationary_min_days: 7
    tiers:
      observer:
        score_range: [0.0, 0.4]
        max_scope:
          operations: [read_file]
          max_invocations: 100
          ttl_seconds: 3600
      standard:
        score_range: [0.4, 0.8]
        max_scope:
          operations: [read_file, write_file, search_files]
          max_invocations: 1000
          ttl_seconds: 86400
        promotion:
          target: trusted
          min_score: 0.75
          min_receipts: 500
          min_days: 30
        demotion:
          target: observer
          triggers:
            - type: score_drop
              threshold: 0.35

runtime_assurance

Configures runtime attestation verification tiers and trusted verifiers.

FieldTypeDescription
tiersmap<string, RuntimeAssuranceTierRule>Named tier rules with minimum attestation tier and scope constraints
trusted_verifiersmap<string, RuntimeAssuranceVerifierRule>Named verifier rules defining accepted attestation sources
yaml
extensions:
  runtime_assurance:
    tiers:
      attested:
        min_tier: attested
        max_scope:
          operations: [read_file, write_file]
          ttl_seconds: 3600
      verified:
        min_tier: verified
        max_scope:
          operations: [read_file, write_file, shell_exec]
          ttl_seconds: 7200
    trusted_verifiers:
      nitro-enclave:
        issuer: did:web:aws.amazon.com
        accepted_measurements:
          - "sha384:0f3a...e91d"
      tpm-vendor-a:
        issuer: did:web:vendor-a.example.com
        accepted_measurements:
          - "sha256:a1b2...c3d4"

Governance Metadata

Optional metadata for policy governance, audit trails, and lifecycle management.

FieldTypeDescription
authorstringPolicy author
approved_bystringApprover name or ID
approval_datestringDate of approval
classificationenumpublic, internal, confidential, or restricted
change_ticketstringChange management ticket reference
lifecycle_stateenumdraft, review, approved, deployed, deprecated, or archived
policy_versionintegerMonotonically increasing version number
effective_datestringDate when the policy takes effect
expiry_datestringDate when the policy expires
yaml
metadata:
  author: security-team
  approved_by: ciso@company.com
  approval_date: "2026-04-01"
  classification: internal
  change_ticket: SEC-1234
  lifecycle_state: deployed
  policy_version: 3
  effective_date: "2026-04-01"
  expiry_date: "2026-10-01"

Complete Example

A comprehensive policy demonstrating most available options:

production-policy.yaml
hushspec: "0.1.0"
name: production-workspace
description: Production policy for governed code agent

rules:
  forbidden_paths:
    enabled: true
    patterns:
      - "**/.env"
      - "**/*.pem"
      - "**/*.key"
      - "**/credentials*"
    exceptions:
      - "**/credentials.example.json"

  path_allowlist:
    enabled: true
    read:
      - ./workspace/**
      - ./docs/**
    write:
      - ./workspace/output/**
    patch:
      - ./workspace/src/**

  egress:
    enabled: true
    default: block
    allow:
      - api.github.com
      - registry.npmjs.org

  secret_patterns:
    enabled: true
    patterns:
      - name: aws_key
        pattern: "AKIA[0-9A-Z]{16}"
        severity: critical
      - name: github_token
        pattern: "ghp_[a-zA-Z0-9]{36}"
        severity: critical

  patch_integrity:
    enabled: true
    max_additions: 500
    max_deletions: 200
    require_balance: true
    max_imbalance_ratio: 5.0

  shell_commands:
    enabled: true
    forbidden_patterns:
      - "rm\\s+-rf"

  tool_access:
    enabled: true
    default: block
    allow:
      - read_file
      - list_directory
      - search_files
    require_confirmation:
      - write_file

extensions:
  posture:
    initial: restricted
    states:
      restricted:
        capabilities: [read_file, list_directory]
        budgets:
          tool_calls: 50
      standard:
        capabilities: [read_file, list_directory, search_files, write_file]
        budgets:
          tool_calls: 500
    transitions:
      - from: restricted
        to: standard
        on: user_approval
      - from: standard
        to: restricted
        on: critical_violation

metadata:
  author: security-team
  classification: internal
  lifecycle_state: deployed
  policy_version: 1