Repository navigation
feat(mcp): add target_scope (local/remote/unknown) per tool configuration (#436) - #541
TassioSales wants to merge 1 commit into
Conversation
blitzcrieg1
left a comment
There was a problem hiding this comment.
Thanks for taking #436. The parsing and the proxy-payload tests look fine, but as it stands the scope never reaches the trail:
-
The ingest drops the field.
build_call_payloadaddstool.target_scope, but the receiver builds each event'stoolblock from a fixed set of keys (apps/orchestrator/agentmetry/core/audit/external.py, theevent["tool"] = {...}block), sotarget_scopeis discarded on arrival. Please carry it through canonicalization, document it indocs/agentmetry-event-schema.mdas an additive field, and add a test that sends a proxy payload through ingest and findstool.target_scopeon the stored event. -
acts_on_recording_hostisn't used. #436 is about remote-acting tools being labelled as activity on the recording host. Nothing calls the predicate yet, so no label changes. Please wire it where host activity is judged (the MITRE mapping and the host-scoped rules), with a test showing that aremotetool no longer produces a local-host technique. -
Minor:
--scope,--tool-scopeandAGENTMETRY_MCP_TOOL_SCOPESsilently turn an unknown value intounknown. A warning on stderr would save someone a confused afternoon.
I'll approve the CI run so you get the full suite on this head.
Summary
Resolves #436.
Introduces an optional target scope per tool (
local,remote,unknown) in the MCP audit proxy, keeping MCP transport (e.g. stdio) and target scope decoupled.Key Changes
local,remote,unknown.--scope tool=remoteor--tool-scope) and environment variableAGENTMETRY_MCP_TOOL_SCOPES.unknownby default.acts_on_recording_host(event)to cleanly exclude tools executing on remote targets from activity statements on the recording host.qualified,input_hash,correlation_id) remains fully visible in the audit trail.local_helper) and a remote tool (emp3r0r_cat).unknown.test_mcp_audit_proxy.pypass cleanly.