Skip to content

feat(detection): guard egress rules + mcp-proxy auto-wrap of agentmetry-guard - #509

Merged
blitzcrieg1 merged 2 commits into
masterfrom
feat/guard-egress-rules
Nov 27, 2026
Merged

blitzcrieg1 merged 2 commits into
masterfrom
feat/guard-egress-rules

Conversation

@blitzcrieg1

Copy link
Copy Markdown
Owner

Two new published detection rules consume network_egress events from the agentmetry-guard sidecar, and agentmetry mcp-proxy can now auto-wrap the MCP server in the guard.

New rules (registered, in BUILTIN_RULE_IDS, Sigma pack regenerated to 30 rules):

  • credential-read-then-egress (critical): credential-access tool call, then a network_egress event in the same session window. This is the child-process escape: a script the agent ran reads ~/.ssh and opens a tunnel without any single tool call looking like exfiltration.
  • guard-egress-denied (high): the sidecar refused a denylisted destination (outcome=denied).

Corpus: 3 new cases (credential-read-then-child-egress, guard-denied, benign npm egress). Benchmark: 115 cases, 20 rules covered, 63/63 firings, 0 missed, 0 false positives.

mcp-proxy auto-wrap: AGENTMETRY_GUARD=1 runs the server under agentmetry-guard wrap (AGENTMETRY_GUARD_BIN to locate it, AGENTMETRY_GUARD_DENY for the denylist). The proxy passes its session id as AGENTMETRY_CORRELATION_ID/AGENTMETRY_SESSION_ID, so guard egress events join the same trail correlation as the proxy's tool_call events. Disabled or missing binary falls back to the raw command; 4 new tests pin that.

README / detection-rules.md counts updated (twenty published rules, 30 Sigma rules, 3052 tests collected).

Tests run locally: readme_claims 16, sigma_pack + benchmark + rule_identity + doctor/remediation + mcp_proxy 86, all passing; ruff clean on changed files.

blitzcrieg1 and others added 2 commits November 27, 2026 17:05
…ry-guard

Two new published rules consuming network_egress events from the
agentmetry-guard sidecar:
- credential-read-then-egress (critical): a credential-access tool call
  followed by a child process opening a connection, inside the sequence
  window. Closes the child-process escape where no single tool call looks
  like exfiltration.
- guard-egress-denied (high): the sidecar refused a denylisted destination
  (outcome=denied).

Corpus gains 3 cases (2 attack, 1 benign npm-egress) covering both rules;
benchmark now 115 cases, 20 rules, 63/63 firings, 0 missed, 0 FP. Sigma
pack regenerated (30 rules). README and detection-rules.md counts updated.

mcp-proxy: with AGENTMETRY_GUARD=1 the wrapped MCP server runs under
agentmetry-guard wrap (AGENTMETRY_GUARD_BIN, AGENTMETRY_GUARD_DENY), with
the proxy session id passed as AGENTMETRY_CORRELATION_ID/SESSION_ID so
guard events join the same trail correlation as the proxy's tool calls.
Off and binary-missing both fall back to the raw command.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <[email protected]>
@blitzcrieg1
blitzcrieg1 merged commit efd1546 into master Nov 27, 2026
10 checks passed
@blitzcrieg1
blitzcrieg1 deleted the feat/guard-egress-rules branch November 27, 2026 15:16
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.

1 participant