Skip to content

Heads-up: predicate-claw policy enforcement silently bypassed for OpenClaw codex-harness agents (upstream: openclaw/openclaw#82350) #17

@Kaspre

Description

@Kaspre

Summary

Heads-up: in current OpenClaw 2026.5.x deployments using the codex harness, predicate-claw policy enforcement is silently bypassed for any agent routed through openai/gpt-* (codex-harness) models. The bug is upstream of predicate-claw (in OpenClaw's codex plugin), and predicate-authorityd itself returns correct decisions when consulted. The problem is that the OpenClaw before_tool_call hook chain — which is what calls into predicate-authorityd for fs.*, shell.exec, http.fetch, etc. — never fires for codex-routed tool calls.

Net effect for predicate-claw users: any OpenAI-codex agent in an OpenClaw deployment effectively has no policy enforcement, even though the policy file and sidecar are correctly loaded. Operators have no visible signal that this is happening — the OC plugin loads, registers, and runs; it just never gets a chance to authorize codex-routed tool calls.

Filed upstream in OpenClaw as openclaw/openclaw#82350 with full reproduction, codex SQLite trace evidence, and three probable transport-point culprits inside OpenClaw's codex plugin.

Affected OpenClaw versions

  • Codex harness code first introduced in OC 2026.4.x (around 2026-04-10)
  • Codex became the preferred runtime for openai/gpt-* models in OC 2026.5.9+
  • Codex externalized as @openclaw/codex npm plugin in OC 2026.5.10+ (plugin install required, but easy to do)
  • Confirmed reproducible on OC 2026.5.12 stable

So: any OC 2026.5.x deployment with @openclaw/codex installed and enabled, dispatching any agent through openai/gpt-* model refs, is silently bypassing predicate-claw policy for those agents. PI-harness agents (any non-OpenAI model, or agentRuntime.id: "pi" forced on OpenAI) are unaffected — those continue to enforce policy correctly.

Why this is upstream-of-you (and what would still help)

This isn't a fix predicate-claw can ship — the bug is in OpenClaw's extensions/codex/src/app-server/native-hook-relay.ts config transport. The OC issue suggests three plausible drop-points and a startup-self-test mitigation.

But two things from your side could help downstream consumers spot this early:

  1. Documentation note in predicate-claw's README / OC integration docs: "Note: on OpenClaw deployments using the codex harness, policy enforcement for openai/gpt-* agents is currently affected by [Bug]: Codex harness — hooks.PreToolUse config never reaches app-server (silent plugin enforcement bypass) openclaw/openclaw#82350; pin those agents to the PI harness via agentRuntime.id: 'pi' until upstream fixes, or accept that codex-routed tool calls bypass the plugin."
  2. Optional: startup self-probe in the predicate-claw OC plugin — fire a no-op test through the relay path after registration; if it fails to round-trip, log a clear SECURITY WARN at gateway log so operators see the bypass exists. (Same idea as suggested fix (1) in #82350 but at your layer.)

Neither is required — the actual fix lives upstream — but the silent-failure characteristic of this bug means operators may run unknowingly exposed for a while. A heads-up in docs would shorten that window.

Reproduction (brief — see #82350 for full)

Two agents on the same OC install with the same predicate-claw policy:

  • agent-pi (any ollama-cloud or non-OpenAI model) → routed through PI harness → policy enforced correctly, plugin logs BLOCKED on denied paths
  • agent-codex (any openai/gpt-* model) → routed through codex harness → plugin handler never fires, denied operations succeed, plugin's audit log captures nothing

Codex's own SQLite trace DB (~/.codex/logs_2.sqlite) confirms it never receives the hooks.PreToolUse config that OC's codex plugin is supposed to inject: across 110K log rows at INFO+TRACE+DEBUG verbosity over 5.8 days, zero occurrences of PreToolUse, pre_tool_use, or any related hook event name.

Filing context

Filing this as informational so predicate-claw maintainers are aware downstream consumers may be affected. Not requesting a fix in this repo — the upstream OC issue is where the actual fix needs to land. Happy to provide additional repro details or test against a fix if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions