Skip to content

Require a verified caller before a bound call is sent - #42

Merged
cursor[bot] merged 1 commit into
mainfrom
cursor/caller-identity-fbb8
Oct 8, 2026
Merged

cursor[bot] merged 1 commit into
mainfrom
cursor/caller-identity-fbb8

Conversation

@warheart1984-ctrl

Copy link
Copy Markdown
Owner

A bound call now requires Authorization: Wicket <token>. The signer and the witness both verify the Ed25519 signature. The caller id that is stored and hashed is the id in the caller key file. call_digest includes that id as the second length-prefixed field for https_request and local_model_tool. Used token ids are written next to the witness log, so a replay is still IDENTITY_UNVERIFIED after a new witness is opened on the same directory. A policy callers map grants effects, target prefixes, risk, and action per caller id.

WICKET_ALLOW_DIRECT_CALLS=1 is unchanged: it still skips the witness, still warns, and still does not require a caller token.

Proven

  • The key-file caller id is on the allow receipt, on the witness started entry, and inside call_digest. runtime/call_binding.py and verifier/ickverify.py agree. An omitted or forged caller id fails ickverify.
  • Caller A cannot use caller B's allow (mismatch, nothing sent).
  • A forged token, a garbage header, and a missing header (opt-out off) are IDENTITY_UNVERIFIED and send nothing.
  • A replayed token is IDENTITY_UNVERIFIED and sends nothing, including after a new witness on the same log directory.
  • A token that claims caller B and is signed with A's key is IDENTITY_UNVERIFIED and sends nothing.
  • A valid caller outside its grant, or stating a different risk, is AUTHORITY_DENIED and sends nothing.
  • With no callers map, the kernel still allows a read or write. infinityctl evaluate does not verify tokens. The witness refuses that receipt when no token is presented.

Push CI on 2890a57c6f4075b6c0e062a3a4611437db892adb is green:

Not proven

  • Observed effect.
  • Observer mode.
  • state_ref.
  • Retries.
  • Heartbeat.
  • Key rotation.
  • Witness compromise.
  • The clock. Token expiry uses the witness clock.
  • Egress. That is deployment, not this code.
  • Two operating-system accounts. These tests are caller A versus caller B in one process.
  • Whoever can write the caller key file can add callers.

User-Agent is sent and is not hashed. It names the HTTP library, and hashing it would split one call into many digests without authenticating anyone. The authorization header value is sent and not hashed. The raw token is not hashed. Streamed known-shape calls stay refused. The opt-out does not derive a digest. Direct infinityctl evaluate does not verify tokens.

Open in Web Open in Cursor 

The signer and the witness check an Ed25519 Wicket token, hash the caller id from the key file into call_digest, and enforce a per-caller grant. Used token ids are stored next to the witness log, so a replay after restart is IDENTITY_UNVERIFIED and nothing is 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-07T23:59:54.920040Z 2890a57 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: 2890a57c6f

ℹ️ 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 thread runtime/caller_token.py
Comment on lines +427 to +430
if self.path.is_file():
existing = self.path.read_text(encoding="utf-8").splitlines()
if jti in existing:
return False

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 Serialize token claims across witness processes

When two witness processes share a log directory, each has its own threading.Lock, so both can read the token-id file before either appends and both return success from commit. This is reproducible during an overlapping restart and allows the same token to authorize two distinct valid allow receipts for the same call, resulting in two dispatches despite the single-use-token guarantee. Use an inter-process file lock or another atomic claim operation around the read-and-append sequence.

Useful? React with 👍 / 👎.

Comment thread README.md
Comment on lines +457 to +459
produces a matching allow and a witness performs the call. `WICKET_CALLER_KEY` is the caller's
private key. `WICKET_CALLER_KEYS` is the public map the signer and the witness trust. Whoever
can write that map can add callers. Direct `infinityctl evaluate` does not verify tokens.

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 Make the documented executor setup provide caller credentials

The runnable command immediately below this text still uses demo/policy.json, which has no callers grant, and it sets neither WICKET_CALLER_KEY nor WICKET_CALLER_KEYS. Following the documented setup therefore always yields IDENTITY_UNVERIFIED (and, after adding credentials alone, AUTHORITY_DENIED) instead of reaching the stated approval/allow flow. The example needs to create/configure a caller key map and use a policy containing a matching grant.

Useful? React with 👍 / 👎.

@cursor
cursor Bot merged commit d677ff6 into main Oct 8, 2026
5 checks passed
@warheart1984-ctrl
warheart1984-ctrl deleted the cursor/caller-identity-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