Skip to content

Fail closed when no witness is configured - #40

Merged
cursor[bot] merged 1 commit into
mainfrom
cursor/witness-default-on-fbb8
Oct 7, 2026
Merged

cursor[bot] merged 1 commit into
mainfrom
cursor/witness-default-on-fbb8

Conversation

@warheart1984-ctrl

Copy link
Copy Markdown
Owner

What this is

The witness requirement is on by default for run_turn, python -m runtime, and gossip. If no witness is configured, those calls are not sent. This does not prove observed effect.

What a reviewer can check

  • run_turn and python -m runtime do not call the provider when no witness is configured. The kernel may still record a decision. On that path the proposal is the runtime's own description (effect read, target the provider name), not a derived call_digest, and there is no outcome because nothing was sent.
  • WICKET_ALLOW_DIRECT_CALLS sends only when it is exactly 1. It prints a warning on stderr every time. It is not in any deploy unit. It does not let gossip skip an allow. Unset is off.
  • Gossip builds an https_request, derives effect, target, and call_digest, and the witness sends it only after a matching allow. No policy or no witness means the peer is not contacted. An unknown shape (an IPv6 peer) is UNKNOWN_CALL_SHAPE and is not sent.

Tests

  • Runtime and run_turn without a witness send nothing.
  • Gossip cannot reach a target without a matching allow.
  • The opt-out is off by default, and setting it to 1 warns.

What this does not prove

  • Observed effect, observer mode, state_ref, retries, heartbeat, and a two-account witness probe.
  • Egress. A caller who can reach the target without the witness is outside this control.
  • Nova model HTTP with NOVA_ICK_POLICY and NOVA_ICK_SERVICE unset still uses the provider client. That kernel gate remains opt-in. The local-dev opt-out does not derive a digest.
  • risk and action are still the caller's claim. The clock is unproven. A compromised witness can sign a false execution. The authorization header is presence-only. User-Agent is sent and not hashed. Streamed known-shape calls stay refused.

Limits are stated in docs/executor-mode.md.

Open in Web Open in Cursor 

run_turn and python -m runtime do not call the provider unless a witness
sends the call. WICKET_ALLOW_DIRECT_CALLS=1 is the local-dev opt-out: off
by default, and it warns on stderr. Gossip derives an https_request and
sends it only through the witness after a matching allow; unknown shapes
are denied and not sent.

Co-authored-by: Jon Halstead <warheart1984@gmail.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T06:07:55.335705Z 60a18cf PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 60a18cf5b7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 58 to +59
summary = signed_gossip_summary()
body = json.dumps(summary).encode("utf-8")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reuse the approved gossip body on retry

When the policy requires approval for writes, the first invocation binds this body into the proposal hash, but signed_gossip_summary() includes the current timestamp and its signature. A human-approved retry in a later second therefore produces a different call_digest and proposal hash, so ApprovalStore.claim() cannot find the approval and gossip remains awaiting approval indefinitely. Preserve the pending signed body for the retry, or otherwise keep the approval-bound request stable.

Useful? React with 👍 / 👎.

Comment thread runtime/chat.py
Comment on lines +52 to +54
def direct_calls_allowed() -> bool:
"""True only when the local-dev opt-out is explicitly set to ``1``. Unset is off."""
return os.environ.get(DIRECT_CALLS_ENV, "").strip() == "1"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Require the literal opt-out value

The documented fail-closed contract says every value other than exactly 1 leaves direct calls disabled, but stripping whitespace also enables values such as " 1" or "1\n". A value imported from a file or secret with a trailing newline can therefore unexpectedly bypass the witness; compare the raw environment value to "1" instead.

Useful? React with 👍 / 👎.

Comment on lines +92 to +94
else:
result = {"peer_id": peer_id, "status": "sent"}
outcome = "completed"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat unsuccessful HTTP responses as gossip failures

When a peer or intermediary returns an HTTP error such as 401 or 500, dispatch_https() still returns the response body and marks the witness execution completed, because http.client does not raise for HTTP status codes. This branch consequently reports status: "sent" and records a completed outcome, whereas the previous urlopen path surfaced those responses as errors. The witness response needs to carry and validate the HTTP status before gossip is classified as completed.

Useful? React with 👍 / 👎.

@cursor
cursor Bot merged commit 535def9 into main Oct 7, 2026
5 checks passed
@warheart1984-ctrl
warheart1984-ctrl deleted the cursor/witness-default-on-fbb8 branch October 15, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants