← all posts

Hardpoint Guardian: Inline Adapter as Host Boundary

Validate + decide + log + return effect; the host owns execution, never the policy engine.

The Adapter Workflow

The inline enforcement adapter is the intended host-integration pattern. It validates, decides, logs, and returns effect data for the host to execute — never executing tools itself.

Required Fields on Every Request

  • Non-empty caller ID — identifies the host making the request
  • Retry-stable correlation ID — preserves identity across retries
  • Absolute Unix-millisecond deadline — policy can reject expired calls

Why This Design?

The adapter pattern ensures:

  1. The policy engine never has an executor callback — it's purely decision-focused
  2. *The host controls how and when to execute allowed effects*
  3. Failed authorization is fail-closed — no effect returned means the host must handle it
  4. Audit records are written before the decision is returned, ensuring durability

Adapter Code Pattern

request = EnforcementRequest(
    caller_id="my-host",
    correlation_id="request-42",
    deadline_unix_ms=time.time_ns() // 1_000_000 + 5_000,
    call=PolicyCall(tool="read_file", args=["README.md"]),
)
response = adapter.authorize(request)

if response.effect is not None:
    host_execute(response.effect)
else:
    handle_terminal_policy_decision(response.decision)

GitHub: https://github.com/argakiig/hp-guardian