Repository navigation
feat(guard): [ADS-1758] identify the runtime hook surface - #561
jakub-kassak wants to merge 4 commits into
Conversation
79d54b2 to
87099a6
Compare
PR Summary by QodoReport Guard installation metadata and runtime agent surfaces
AI Description
Merge Risk
|
Code Review by Qodo
1. Copilot events without markers get a new label
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8fd2e45. Configure here.
8fd2e45 to
028e2bb
Compare
544dc72 to
1bfcc9c
Compare
f1251f4 to
fdb2d92
Compare
|
The Qodo finding “Copilot events without markers get a new label” is addressed in the current diff. Bash, PowerShell, and Python discovery now send the same bounded evidence format. When both Agent Monitor #601 records that request as Coverage includes the shared markerless sender case, the Bash and PowerShell forwarder test, the Python discovery test, and the receiver’s log and metric assertions. |
Related: ADS-1758 Co-Authored-By: Codex <codex@openai.com>
Send the Cursor socket marker without its path in all hook senders. Cover Codex CLI hooks without an originator and remove the internal documentation link from the public README. Related: ADS-1758 Co-authored-by: FORGE <forge@snyk.io>
Encode Unicode in the evidence header and bound values to 128 code points across Bash, PowerShell, and Python. Avoid switching Bash's locale while preparing the header. Related: ADS-1758 Co-authored-by: FORGE <forge@snyk.io>
Filter inherited surface markers in the installer's child process while keeping the Windows argument renderer's original contract. Related: ADS-1758 Co-authored-by: FORGE <forge@snyk.io>
969c58c to
c2d8b1f
Compare

Regular hooks and runtime discovery send bounded environment markers in
X-Agent-Surface-Evidence. Agent Monitor classifies the surface. Installer events omit both surface headers.Release after snyk/agent-monitor#601 is deployed. The surface guide documents the marker rules. The Copilot VS Code marker was seen in the runtime process and still needs confirmation from a successful live hook.
Note
Medium Risk
Changes the hook wire contract and all forwarder paths Agent Monitor uses for surface attribution; incorrect evidence or installer leakage could misclassify runtime hooks across clients.
Overview
Runtime hook delivery now reports which agent surface actually invoked the hook by sending a JSON
X-Agent-Surface-Evidenceheader with client-specific environment markers (Claude, Codex, Cursor, and Copilot each have their own set).X-Agent-Surfaceand Copilot-only classification are removed; Agent Monitor is expected to classify surfaces from this evidence.Installer/setup traffic (
hooksConfigured, server discovery during install, unconfirmed test events) does not attach surface evidence, so aguard installrun inside an agent session is not misread as runtime.guardstrips those marker env vars when it subprocesses hook scripts during install verification for the same reason.Values are bounded and sanitized (per-client marker lists, 128 code-point cap,
nullfor sensitive Cursor paths/sockets and oversize values) in Python, bash, and PowerShell forwarders. Unit and e2e tests assert the install-vs-runtime split and shared wire cases across forwarders andsend_hook_event.Reviewed by Cursor Bugbot for commit c2d8b1f. Bugbot is set up for automated code reviews on this repo. Configure here.