agentmetry 0.11.0__tar.gz → 0.12.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {agentmetry-0.11.0 → agentmetry-0.12.0}/Dockerfile +1 -1
- {agentmetry-0.11.0 → agentmetry-0.12.0}/PKG-INFO +2 -2
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/api/routes/audit.py +31 -1
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/cli/__init__.py +3 -0
- agentmetry-0.12.0/agentmetry/core/audit/detection/artifacts.py +140 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/live.py +3 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/models.py +6 -1
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/external.py +3 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/hook_bootstrap.py +1 -0
- agentmetry-0.12.0/agentmetry/core/audit/invocation.py +90 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/tool_policy/evaluator.py +9 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/tool_policy/loader.py +17 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/tool_policy/models.py +2 -0
- agentmetry-0.12.0/agentmetry/core/audit/tool_policy/shell_writes.py +190 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/diagnostics/machine_view.py +1 -1
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/version.py +1 -1
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/404.html +1 -1
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/__next.__PAGE__.txt +4 -4
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/__next._full.txt +4 -4
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/__next._tree.txt +1 -1
- agentmetry-0.12.0/agentmetry/dashboard_static/_next/static/chunks/08zk5z0a15kn3.js +1 -0
- agentmetry-0.12.0/agentmetry/dashboard_static/_next/static/chunks/0kqziy-7_gy73.js +31 -0
- agentmetry-0.12.0/agentmetry/dashboard_static/_next/static/chunks/0lk_p6zadi35e.js +22 -0
- agentmetry-0.12.0/agentmetry/dashboard_static/_next/static/chunks/3g53m66ammiau.js +4 -0
- agentmetry-0.12.0/agentmetry/dashboard_static/_next/static/chunks/3jn_x8ihwq16e.js +1 -0
- agentmetry-0.12.0/agentmetry/dashboard_static/_next/static/chunks/3qfy96eoyh-ek.js +1 -0
- agentmetry-0.11.0/agentmetry/dashboard_static/_next/static/chunks/turbopack-3-ry682tkyiqk.js → agentmetry-0.12.0/agentmetry/dashboard_static/_next/static/chunks/turbopack-2u1d16houkiyo.js +1 -1
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/_not-found/__next._full.txt +2 -2
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/_not-found/__next._not-found.__PAGE__.txt +2 -2
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/_not-found/__next._tree.txt +1 -1
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/_not-found.html +1 -1
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/_not-found.txt +2 -2
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/index.html +1 -1
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/index.txt +4 -4
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/hooks/ingest.py +35 -5
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/policies/tool/manifest.yaml +24 -5
- {agentmetry-0.11.0 → agentmetry-0.12.0}/pyproject.toml +1 -1
- agentmetry-0.12.0/tests/test_audit_policy_regressions.py +195 -0
- agentmetry-0.12.0/tests/test_claude_invocation.py +286 -0
- agentmetry-0.12.0/tests/test_detection_artifacts.py +236 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_funding_manifest.py +2 -1
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_scanner.py +3 -1
- agentmetry-0.12.0/tests/test_supply_chain_boundaries.py +226 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_tool_policy_agent_cli.py +4 -4
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_version.py +11 -0
- agentmetry-0.11.0/agentmetry/dashboard_static/_next/static/chunks/0umf92h1sb77c.js +0 -1
- agentmetry-0.11.0/agentmetry/dashboard_static/_next/static/chunks/1q292q_rc4_p6.js +0 -22
- agentmetry-0.11.0/agentmetry/dashboard_static/_next/static/chunks/216iyidhmrh3u.js +0 -1
- agentmetry-0.11.0/agentmetry/dashboard_static/_next/static/chunks/31qp8jfkw0x2h.js +0 -31
- agentmetry-0.11.0/agentmetry/dashboard_static/_next/static/chunks/3e_9wdzec2s0j.js +0 -4
- agentmetry-0.11.0/agentmetry/dashboard_static/_next/static/chunks/3ia-1961js2lo.js +0 -1
- {agentmetry-0.11.0 → agentmetry-0.12.0}/.dockerignore +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/.env.agentmetry-demo +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/.env.example +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/.gitignore +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/README.md +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/__init__.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/api/__init__.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/api/main.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/api/routes/__init__.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/api/routes/auth.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/api/trusted_host.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/api/websocket.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/api/ws_bridge.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/cli/__main__.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/__init__.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/account.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/api_token.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/__init__.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/adapters/__init__.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/adapters/agt.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/adapters/chronicle.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/adapters/cloudevents.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/adapters/ecs.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/adapters/sentinel.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/adapters/splunk.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/alerts.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/antigravity_trajectory.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/atlas.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/canonical.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/cloud_bridge.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/compliance_digest.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/cursor_cloud_cache.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/__init__.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/benchmark.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_approval_denied_then_executed.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_arbitrary_host_stage_execute.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_autonomous_unapproved_write.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_credential_exfil.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_credential_then_cloud_api.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_destructive_delete_burst.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_discovery_then_collect.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_dotfile_then_git_push.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_encoded_command_download.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_env_credential_exfil.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_hashed_only_no_command.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_interpreter_egress.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_pr_merged_without_review.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_proc_substitution_cradle.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_remote_pipe_to_shell.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_remote_staging_then_execute.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_secret_manager_then_egress.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_session_tool_burst.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_single_command_exfil.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_single_quoted_interpreter_egress.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_ssh_directory_exfil.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_subagent_swarm.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_timestamp_collision.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_untrusted_input_then_action.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_authoring_merge_fixtures.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_autonomous_after_approval.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_build_artifact_cleanup.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_ci_artifact_download.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_commit_message_names_cloud_clis.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_container_registry_publish.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_database_migration.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_dependency_audit_network_burst.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_dependency_install_and_build.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_download_release_archive.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_env_example_read.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_fetch_data_then_run_repo_script.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_fetch_dataset_then_analyse.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_fetch_lockfile_then_install.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_fetch_piped_into_own_script.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_git_review_and_push.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_github_raw_docs_then_script.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_human_driven_deletes.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_local_api_probing.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_long_but_calm_session.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_loopback_is_not_egress.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_loopback_pipe_to_interpreter.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_mcp_text_mentions_credential_path.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_ordinary_development.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_package_manager_after_fetch.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_reading_config_that_is_not_secret.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_remote_api_call_no_credentials.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_research_then_docs.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_reversed_order_is_not_exfil.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_secret_names_and_docs.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_terraform_apply_with_profile.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_test_and_fix_loop.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_writing_about_credentials.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/corpus.yaml +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/disposition.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/engine.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/live_store.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/rules.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/traits.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/yaml_config.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/detection/yaml_rules.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/dlp/__init__.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/dlp/loader.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/dlp/models.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/dlp/scanner.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/dogfood.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/evidence_pack.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/forwarder.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/grok_bot_transcript.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/hashing.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/heartbeat.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/identity.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/identity_view.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/ingest.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/ingest_quota.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/managed_hooks.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/mcp_inventory_event.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/migrate.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/mitre.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/otel_ingest.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/personal_domains.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/policy.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/policy_settings.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/posture_event.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/redaction.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/replay.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/run_context.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/session_tree.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/signing.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/sinks.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/spool.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/tool_policy/__init__.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/tool_policy/capability.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/trail_anchor.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/trail_chain.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/trail_db.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/trail_merkle.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/audit/trail_rotation.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/auth.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/bus/__init__.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/bus/audit_exporter.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/bus/bridges.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/bus/bus.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/bus/events.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/bus/outbox.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/config.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/dashboard_session.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/diagnostics/__init__.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/diagnostics/autostart.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/diagnostics/doctor.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/diagnostics/driver_paths.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/diagnostics/env_file.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/diagnostics/hook_coverage.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/diagnostics/mcp_inventory.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/diagnostics/mcp_schema.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/diagnostics/posture.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/drivers/__init__.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/drivers/host.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/drivers/permissions.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/drivers/spec.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/extensions.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/health.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/managed_policy.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/operator_identity.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/paths.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/scanner/__init__.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/scanner/injection.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/scanner/instruction_files.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/scanner/known_packages.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/scanner/scan.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/core/scanner/typosquat.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/.gitkeep +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/chunks/0cz1d0mv5g_q7.js +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/chunks/1ix59xuhq-q14.css +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/chunks/2c45lmylpxhfd.css +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/media/ibm-plex-mono-latin-400-normal.2lhng2ntocry9.woff +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/media/ibm-plex-mono-latin-400-normal.3xdfs0-p_zi4c.woff2 +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/media/ibm-plex-mono-latin-500-normal.11q3guvgd1r20.woff2 +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/media/ibm-plex-mono-latin-500-normal.1fgk-kmy-32_a.woff +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/media/ibm-plex-sans-latin-400-normal.19i24--p24z3r.woff +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/media/ibm-plex-sans-latin-400-normal.1xf5nwxyfigak.woff2 +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/media/ibm-plex-sans-latin-500-normal.14sc3d7sk_zzh.woff +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/media/ibm-plex-sans-latin-500-normal.2i4a1iuj6lbvw.woff2 +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/media/ibm-plex-sans-latin-600-normal.2ovda_azncp9b.woff2 +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/media/ibm-plex-sans-latin-600-normal.2wn5p1s7u3utm.woff +0 -0
- {agentmetry-0.11.0/agentmetry/dashboard_static/_next/static/I3_iDrRGGxdmaK4mZ_Hif → agentmetry-0.12.0/agentmetry/dashboard_static/_next/static/oPjtzGxzqOqWdv6GOzeru}/_buildManifest.js +0 -0
- {agentmetry-0.11.0/agentmetry/dashboard_static/_next/static/I3_iDrRGGxdmaK4mZ_Hif → agentmetry-0.12.0/agentmetry/dashboard_static/_next/static/oPjtzGxzqOqWdv6GOzeru}/_clientMiddlewareManifest.js +0 -0
- {agentmetry-0.11.0/agentmetry/dashboard_static/_next/static/I3_iDrRGGxdmaK4mZ_Hif → agentmetry-0.12.0/agentmetry/dashboard_static/_next/static/oPjtzGxzqOqWdv6GOzeru}/_ssgManifest.js +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/dashboard_static/agentmetry-icon-white.svg +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/demo.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/hooks/__init__.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/hooks/mcp_proxy.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/policies/detection/manifest.yaml +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/policies/dlp/manifest.yaml +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/agentmetry/policies/opa/agent_rules.rego +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/conftest.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/fixtures/agt_filesink_exfil.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/fixtures/agt_filesink_mixed.jsonl +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/fixtures/codex_hooks/README.md +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/fixtures/codex_hooks/permission-request.command.output.schema.json +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/fixtures/codex_hooks/pre-tool-use.command.output.schema.json +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/fixtures/fake_mcp_server.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/fixtures/otel_claude_code_session.json +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/fixtures/scanner/benign_skill/SKILL.md +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/fixtures/scanner/benign_tools.json +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/fixtures/scanner/poisoned_skill/SKILL.md +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/fixtures/scanner/poisoned_tools.json +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_account_identity.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_agentmetry_audit.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_agentmetry_ingest_client.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_agt_adapter.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_antigravity_trajectory.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_ask_gate_phase_a.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_atlas_detection_enrichment.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_atlas_mapping.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_audit_sinks.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_audit_stats.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_audit_tail.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_auth.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_auth_default.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_autostart.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_boot_sequence.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_burst_windows.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_chinese_agent_hooks.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_chinese_agent_sprint_b.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_chinese_agent_sprint_c.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_chronicle_adapter.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_classification_bounds.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_cli_backup.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_cli_commands.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_cli_env_var_names.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_cloud_bridge.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_cloudevents_adapter.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_codex_account.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_codex_windows_command.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_compliance_digest.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_container_and_legacy_runtime.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_copilot_hooks.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_coverage_observed.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_crewai_adapter.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_cursor_cloud_cache.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_demo.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_demo_isolation.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_demo_mode_flag.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_detection_adi.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_detection_benchmark.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_detection_default_config.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_detection_disposition.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_detection_disposition_api.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_detection_duplicate_emission.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_detection_emit_durability.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_detection_engine.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_detection_evasion.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_detection_hf_incident.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_detection_quoted_command_words.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_detection_rule_identity.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_detection_rules_v2.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_dlp_agent_env_override.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_dlp_invisible_unicode.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_dlp_markdown_exfil.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_dlp_scanner.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_doctor.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_doctor_first_run.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_doctor_json_and_remediation.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_dogfood.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_dogfood_freeze.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_driver_paths.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_ecs_threat.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_event_bus.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_event_signing.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_evidence_pack.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_extensions.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_external_ingest.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_fail_closed_partial.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_forwarder.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_forwarding_shape.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_grok_bot_transcript.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_hash_key.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_heartbeat.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_hook_bootstrap.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_hook_coverage.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_hook_decision_format.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_hook_enforcement_timing.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_hook_import_cost.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_hook_real_process.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_hook_spool.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_identity_enrich.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_identity_provider.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_identity_view.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_ingest_rate_limit.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_ingest_roundtrip.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_ingest_token.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_isolation.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_launch_targets.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_live_detection.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_live_detection_store.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_machine_view.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_managed_hooks.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_managed_policy.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_mcp_audit_proxy.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_mcp_concealed_text.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_mcp_inventory.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_mcp_inventory_event.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_mcp_meta_fingerprint.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_mcp_proxy_packaged.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_mcp_schema.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_mitre_dlp.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_opensre_adapter.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_operator_attribution.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_otel_ingest.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_paths.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_personal_domains.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_posture.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_powershell_encoding.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_readme_claims.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_redaction.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_replay.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_sentinel.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_serve_script_binds_loopback.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_session_tree.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_shared_install.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_sigma_pack.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_static_serving.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_subagent_lifecycle.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_suite_leaves_real_home_alone.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_tool_policy.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_tool_policy_git_hooks.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_trail_anchor.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_trail_chain.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_trail_concurrency.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_trail_merkle.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_transcript_watcher.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_trusted_host.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_unattended_agent_policy.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_user_profile_dir.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tests/test_yaml_detection_rules.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tools/generate_sigma_pack.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tools/mcp_audit_proxy.py +0 -0
- {agentmetry-0.11.0 → agentmetry-0.12.0}/tools/vault_fs_server.py +0 -0
|
@@ -20,7 +20,7 @@ COPY apps/dashboard/ ./
|
|
|
20
20
|
ENV NEXT_PUBLIC_SAME_ORIGIN=true
|
|
21
21
|
RUN npm run build
|
|
22
22
|
|
|
23
|
-
FROM python:3.12-slim@sha256:
|
|
23
|
+
FROM python:3.12-slim@sha256:5e2bdb1b0d542d5039cffb8181c65930093949194a65c365dfb1b0fe13a4fa5b
|
|
24
24
|
WORKDIR /app
|
|
25
25
|
|
|
26
26
|
COPY apps/orchestrator/ ./
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: agentmetry
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.12.0
|
|
4
4
|
Summary: Open-source security for AI coding agents: record, detect and block at the tool boundary, with a verifiable audit trail and SIEM forwarding
|
|
5
5
|
Project-URL: Homepage, https://agentmetry.ai
|
|
6
6
|
Project-URL: Source, https://github.com/blitzcrieg1/agentmetry
|
|
@@ -37,7 +37,7 @@ Provides-Extra: dev
|
|
|
37
37
|
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
|
|
38
38
|
Requires-Dist: pytest-cov>=6.0; extra == 'dev'
|
|
39
39
|
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
40
|
-
Requires-Dist: ruff==0.17.
|
|
40
|
+
Requires-Dist: ruff==0.17.4; extra == 'dev'
|
|
41
41
|
Description-Content-Type: text/markdown
|
|
42
42
|
|
|
43
43
|
# Agentmetry
|
|
@@ -10,11 +10,12 @@ from typing import Any, Literal
|
|
|
10
10
|
|
|
11
11
|
from fastapi import APIRouter, Depends, HTTPException, Query, Request
|
|
12
12
|
from fastapi.responses import FileResponse
|
|
13
|
-
from pydantic import BaseModel, Field, field_validator
|
|
13
|
+
from pydantic import BaseModel, Field, field_validator, model_validator
|
|
14
14
|
|
|
15
15
|
from agentmetry.core.auth import require_api_key, require_ingest_key
|
|
16
16
|
from agentmetry.core.audit.detection.disposition import STATUSES, get_disposition_store
|
|
17
17
|
from agentmetry.core.audit.ingest import ingest_external_event
|
|
18
|
+
from agentmetry.core.audit.invocation import MAX_DURATION_MS, normalize_claude_tool_metadata
|
|
18
19
|
from agentmetry.core.config import settings
|
|
19
20
|
|
|
20
21
|
router = APIRouter(prefix="/audit", tags=["audit"])
|
|
@@ -31,6 +32,22 @@ _RUN_ACTION_TYPES = frozenset({
|
|
|
31
32
|
})
|
|
32
33
|
|
|
33
34
|
|
|
35
|
+
class IngestInvocationBody(BaseModel):
|
|
36
|
+
"""Source-reported call identity, never proof of execution or approval."""
|
|
37
|
+
|
|
38
|
+
id: str | None = Field(default=None, min_length=1, max_length=256, pattern=r"^[!-~]+$")
|
|
39
|
+
phase: Literal["request", "result"]
|
|
40
|
+
hook_event: Literal["PreToolUse", "PostToolUse", "PostToolUseFailure"]
|
|
41
|
+
provenance: Literal["harness_reported"]
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class IngestToolResultBody(BaseModel):
|
|
45
|
+
status: Literal["reported_success", "reported_failure"]
|
|
46
|
+
duration_ms: int | None = Field(default=None, strict=True, ge=0, le=MAX_DURATION_MS)
|
|
47
|
+
is_interrupt: bool | None = Field(default=None, strict=True)
|
|
48
|
+
error_kind: Literal["tool_failure", "interrupted"] | None = None
|
|
49
|
+
|
|
50
|
+
|
|
34
51
|
class IngestToolBody(BaseModel):
|
|
35
52
|
qualified: str = ""
|
|
36
53
|
server: str = ""
|
|
@@ -49,6 +66,19 @@ class IngestToolBody(BaseModel):
|
|
|
49
66
|
# both were dropped here, the third time this model has done that.
|
|
50
67
|
classification: str = ""
|
|
51
68
|
input_hash_alg: str = ""
|
|
69
|
+
invocation: IngestInvocationBody | None = None
|
|
70
|
+
result: IngestToolResultBody | None = None
|
|
71
|
+
|
|
72
|
+
@model_validator(mode="before")
|
|
73
|
+
@classmethod
|
|
74
|
+
def _bounded_observation_metadata(cls, value: Any) -> Any:
|
|
75
|
+
if not isinstance(value, dict):
|
|
76
|
+
return value
|
|
77
|
+
# Normalize before Pydantic can turn "12", 12.0 or False into an int.
|
|
78
|
+
# Direct/spool ingest repeats the same allowlist in external.py.
|
|
79
|
+
clean = {key: item for key, item in value.items() if key not in ("invocation", "result")}
|
|
80
|
+
clean.update(normalize_claude_tool_metadata(value))
|
|
81
|
+
return clean
|
|
52
82
|
|
|
53
83
|
|
|
54
84
|
#: Actor kinds a capture surface may assert. Anything else is coerced to
|
|
@@ -1618,6 +1618,9 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
1618
1618
|
description="Agentmetry local ops. New here? Start with `agentmetry demo`.",
|
|
1619
1619
|
)
|
|
1620
1620
|
_add_dir_flags(parser)
|
|
1621
|
+
from agentmetry.core.version import __version__
|
|
1622
|
+
|
|
1623
|
+
parser.add_argument("--version", action="version", version=f"agentmetry {__version__}")
|
|
1621
1624
|
parser.add_argument("--port", type=int, default=8000)
|
|
1622
1625
|
sub = parser.add_subparsers(dest="command", required=True)
|
|
1623
1626
|
# First, so it heads the help: it is the one command that needs nothing set up.
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"""Bounded evidence snapshots from the events a live finding actually cites.
|
|
2
|
+
|
|
3
|
+
No I/O, additional capture, command interpretation or reconstruction from hashes.
|
|
4
|
+
These remain reported tool-boundary observations, not OS process evidence.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import json
|
|
10
|
+
from typing import Any
|
|
11
|
+
from urllib.parse import urlsplit, urlunsplit
|
|
12
|
+
|
|
13
|
+
from agentmetry.core.audit.redaction import scrub_secrets
|
|
14
|
+
|
|
15
|
+
from .models import Detection
|
|
16
|
+
|
|
17
|
+
MAX_ITEMS = 32
|
|
18
|
+
MAX_BYTES = 64 * 1024
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _mapping(value: Any) -> dict[str, Any]:
|
|
22
|
+
return value if isinstance(value, dict) else {}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def _snapshot(event: dict[str, Any]) -> dict[str, Any]:
|
|
26
|
+
item: dict[str, Any] = {}
|
|
27
|
+
omitted: list[str] = []
|
|
28
|
+
sanitized: list[str] = []
|
|
29
|
+
|
|
30
|
+
def copy(source, target, key, prefix="", limit=512):
|
|
31
|
+
value = source.get(key)
|
|
32
|
+
if not isinstance(value, str) or not value:
|
|
33
|
+
return
|
|
34
|
+
label = f"{prefix}.{key}" if prefix else key
|
|
35
|
+
if len(value) > limit:
|
|
36
|
+
omitted.append(label)
|
|
37
|
+
return
|
|
38
|
+
cleaned = scrub_secrets(value)
|
|
39
|
+
if len(cleaned) > limit:
|
|
40
|
+
omitted.append(label)
|
|
41
|
+
return
|
|
42
|
+
if cleaned != value:
|
|
43
|
+
sanitized.append(label)
|
|
44
|
+
target[key] = cleaned
|
|
45
|
+
|
|
46
|
+
for key in ("event_id", "correlation_id", "timestamp_utc"):
|
|
47
|
+
copy(event, item, key)
|
|
48
|
+
for section, keys in (
|
|
49
|
+
("source", ("app", "adapter")),
|
|
50
|
+
("action", ("type", "outcome", "reason")),
|
|
51
|
+
("tool", ("name", "qualified", "server", "command")),
|
|
52
|
+
("gated_action", ("tool", "server")),
|
|
53
|
+
):
|
|
54
|
+
source, target = _mapping(event.get(section)), {}
|
|
55
|
+
for key in keys:
|
|
56
|
+
copy(source, target, key, section, 4096 if key in {"command", "reason"} else 512)
|
|
57
|
+
if target:
|
|
58
|
+
item[section] = target
|
|
59
|
+
|
|
60
|
+
arguments = _mapping(_mapping(event.get("tool")).get("arguments"))
|
|
61
|
+
selected: dict[str, Any] = {}
|
|
62
|
+
for key in ("file_path", "path", "target_file"):
|
|
63
|
+
copy(arguments, selected, key, "tool.arguments", 2048)
|
|
64
|
+
url = arguments.get("url")
|
|
65
|
+
if isinstance(url, str) and url:
|
|
66
|
+
label = "tool.arguments.url"
|
|
67
|
+
try:
|
|
68
|
+
if len(url) > 2048 or any(c.isspace() or ord(c) < 32 for c in url):
|
|
69
|
+
raise ValueError("invalid URL")
|
|
70
|
+
# Remove userinfo before parsing, including redaction placeholders
|
|
71
|
+
# from canonicalization, which are not valid bracketed hostnames.
|
|
72
|
+
scheme, separator, rest = url.partition("://")
|
|
73
|
+
if not separator:
|
|
74
|
+
raise ValueError("not an absolute URL")
|
|
75
|
+
authority, slash, path = rest.partition("/")
|
|
76
|
+
# A query or fragment can begin before any path slash.
|
|
77
|
+
authority_end = min((i for i, c in enumerate(authority) if c in "?#"), default=len(authority))
|
|
78
|
+
tail = authority[authority_end:] + (slash + path if slash else "")
|
|
79
|
+
authority = authority[:authority_end].rsplit("@", 1)[-1]
|
|
80
|
+
parsed = urlsplit(f"{scheme}://{authority}{tail}")
|
|
81
|
+
if parsed.scheme not in {"http", "https"} or not parsed.hostname:
|
|
82
|
+
raise ValueError("unsupported URL")
|
|
83
|
+
_ = parsed.port # Reject malformed ports without retaining userinfo.
|
|
84
|
+
cleaned = scrub_secrets(urlunsplit((parsed.scheme, parsed.netloc, parsed.path, "", "")))
|
|
85
|
+
if len(cleaned) > 2048:
|
|
86
|
+
raise ValueError("overlong scrubbed URL")
|
|
87
|
+
selected["url"] = cleaned
|
|
88
|
+
if cleaned != url:
|
|
89
|
+
sanitized.append(label)
|
|
90
|
+
except ValueError:
|
|
91
|
+
omitted.append(label)
|
|
92
|
+
if selected:
|
|
93
|
+
item.setdefault("tool", {})["arguments"] = selected
|
|
94
|
+
if omitted:
|
|
95
|
+
item["omitted_fields"] = omitted
|
|
96
|
+
if sanitized:
|
|
97
|
+
item["sanitized_fields"] = sanitized
|
|
98
|
+
return item
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def build_artifacts(
|
|
102
|
+
detection: Detection,
|
|
103
|
+
events: list[dict[str, Any]],
|
|
104
|
+
trigger: dict[str, Any],
|
|
105
|
+
*,
|
|
106
|
+
host_scope: bool = False,
|
|
107
|
+
) -> dict[str, Any]:
|
|
108
|
+
"""Copy only uniquely identified, in-scope source rows, in reference order."""
|
|
109
|
+
references = list(dict.fromkeys(detection.event_ids))
|
|
110
|
+
index: dict[str, list[dict[str, Any]]] = {}
|
|
111
|
+
for event in events:
|
|
112
|
+
event_id = event.get("event_id")
|
|
113
|
+
if isinstance(event_id, str):
|
|
114
|
+
index.setdefault(event_id, []).append(event)
|
|
115
|
+
block: dict[str, Any] = {
|
|
116
|
+
"version": 1, "items": [], "referenced_count": len(references),
|
|
117
|
+
"unavailable_count": 0, "omitted_count": 0, "truncated": False,
|
|
118
|
+
}
|
|
119
|
+
for event_id in references:
|
|
120
|
+
candidates = index.get(event_id, [])
|
|
121
|
+
event = candidates[0] if len(candidates) == 1 else None
|
|
122
|
+
if (
|
|
123
|
+
event is None
|
|
124
|
+
or not event_id
|
|
125
|
+
or len(event_id) > 512
|
|
126
|
+
or any(event.get(k) != trigger.get(k) for k in ("host_id", "fleet_id"))
|
|
127
|
+
or (not host_scope and event.get("correlation_id") != detection.correlation_id)
|
|
128
|
+
):
|
|
129
|
+
block["unavailable_count"] += 1
|
|
130
|
+
continue
|
|
131
|
+
if len(block["items"]) >= MAX_ITEMS:
|
|
132
|
+
block["omitted_count"] += 1
|
|
133
|
+
continue
|
|
134
|
+
item = _snapshot(event)
|
|
135
|
+
block["items"].append(item)
|
|
136
|
+
if len(json.dumps(block).encode("utf-8")) > MAX_BYTES - 128:
|
|
137
|
+
block["items"].pop()
|
|
138
|
+
block["omitted_count"] += 1
|
|
139
|
+
block["truncated"] = bool(block["omitted_count"] or any(i.get("omitted_fields") for i in block["items"]))
|
|
140
|
+
return block
|
|
@@ -26,6 +26,7 @@ from agentmetry.core.audit.atlas import atlas_for_rule
|
|
|
26
26
|
from agentmetry.core.audit.canonical import SCHEMA_VERSION
|
|
27
27
|
from agentmetry.core.audit.identity import identity_fields
|
|
28
28
|
|
|
29
|
+
from .artifacts import build_artifacts
|
|
29
30
|
from .engine import run_detections, run_host_detections
|
|
30
31
|
from .live_store import get_live_store
|
|
31
32
|
from .models import Detection
|
|
@@ -57,6 +58,7 @@ def observe(canonical: dict[str, Any]) -> list[Detection]:
|
|
|
57
58
|
if detection.rule_id in seen_in_batch or store.is_emitted(corr, detection.rule_id):
|
|
58
59
|
continue
|
|
59
60
|
seen_in_batch.add(detection.rule_id)
|
|
61
|
+
detection.artifacts = build_artifacts(detection, events, canonical)
|
|
60
62
|
fresh.append(detection)
|
|
61
63
|
return fresh
|
|
62
64
|
|
|
@@ -76,6 +78,7 @@ def observe_host(canonical: dict[str, Any]) -> list[Detection]:
|
|
|
76
78
|
if detection.rule_id in seen_in_batch or store.is_host_emitted(host_id, detection.rule_id):
|
|
77
79
|
continue
|
|
78
80
|
seen_in_batch.add(detection.rule_id)
|
|
81
|
+
detection.artifacts = build_artifacts(detection, events, canonical, host_scope=True)
|
|
79
82
|
fresh.append(detection)
|
|
80
83
|
return fresh
|
|
81
84
|
|
|
@@ -36,9 +36,11 @@ class Detection:
|
|
|
36
36
|
# produced by the rule. A detection nobody dispositioned is an alert, not a
|
|
37
37
|
# control, so every detection carries the field even when it is untouched.
|
|
38
38
|
disposition: dict[str, Any] | None = None
|
|
39
|
+
# Optional snapshot attached by the live observer, outside the frozen rules.
|
|
40
|
+
artifacts: dict[str, Any] | None = None
|
|
39
41
|
|
|
40
42
|
def as_dict(self) -> dict[str, Any]:
|
|
41
|
-
|
|
43
|
+
result = {
|
|
42
44
|
"rule_id": self.rule_id,
|
|
43
45
|
"title": self.title,
|
|
44
46
|
"severity": self.severity,
|
|
@@ -51,3 +53,6 @@ class Detection:
|
|
|
51
53
|
"last_seen_utc": self.last_seen_utc,
|
|
52
54
|
"disposition": self.disposition,
|
|
53
55
|
}
|
|
56
|
+
if self.artifacts is not None:
|
|
57
|
+
result["artifacts"] = self.artifacts
|
|
58
|
+
return result
|
|
@@ -8,6 +8,7 @@ from datetime import datetime, timezone
|
|
|
8
8
|
from typing import Any, Literal
|
|
9
9
|
|
|
10
10
|
from agentmetry.core.audit.canonical import SCHEMA_VERSION
|
|
11
|
+
from agentmetry.core.audit.invocation import normalize_claude_tool_metadata
|
|
11
12
|
from agentmetry.core.account import account_from_claim
|
|
12
13
|
from agentmetry.core.audit.identity import identity_fields
|
|
13
14
|
from agentmetry.core.audit.hashing import arguments_fingerprint
|
|
@@ -215,6 +216,8 @@ def build_external_canonical(payload: dict[str, Any]) -> dict[str, Any]:
|
|
|
215
216
|
"input_hash": input_hash,
|
|
216
217
|
"parameters_redacted": not bool(command) and not isinstance(tool_block.get("arguments"), dict),
|
|
217
218
|
}
|
|
219
|
+
if source_app == "claude" and adapter == "claude_hook":
|
|
220
|
+
event["tool"].update(normalize_claude_tool_metadata(tool_block))
|
|
218
221
|
if command:
|
|
219
222
|
event["tool"]["command"] = scrub_secrets(command)[:4096]
|
|
220
223
|
if isinstance(tool_block.get("arguments"), dict):
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"""Bounded Claude hook observations, not independently verified execution.
|
|
2
|
+
|
|
3
|
+
Keep this stdlib-only: it is imported in the hook process as well as the
|
|
4
|
+
receiver. Both paths must retain the same subset without Pydantic coercion.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from typing import Any
|
|
10
|
+
|
|
11
|
+
MAX_INVOCATION_ID = 256
|
|
12
|
+
MAX_DURATION_MS = (1 << 53) - 1
|
|
13
|
+
_PHASES = {
|
|
14
|
+
"PreToolUse": "request",
|
|
15
|
+
"PostToolUse": "result",
|
|
16
|
+
"PostToolUseFailure": "result",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def normalize_claude_tool_metadata(tool: object) -> dict[str, Any]:
|
|
21
|
+
"""Allowlist normalized metadata; invalid optional scalars stay absent.
|
|
22
|
+
|
|
23
|
+
Invalid phase/status combinations drop the new blocks, not the event.
|
|
24
|
+
Never copy response bodies, free-text errors, paths or arbitrary fields.
|
|
25
|
+
"""
|
|
26
|
+
if not isinstance(tool, dict):
|
|
27
|
+
return {}
|
|
28
|
+
raw = tool.get("invocation")
|
|
29
|
+
if not isinstance(raw, dict):
|
|
30
|
+
return {}
|
|
31
|
+
hook = raw.get("hook_event")
|
|
32
|
+
if not isinstance(hook, str) or hook not in _PHASES:
|
|
33
|
+
return {}
|
|
34
|
+
phase = _PHASES[hook]
|
|
35
|
+
if raw.get("phase") != phase or raw.get("provenance") != "harness_reported":
|
|
36
|
+
return {}
|
|
37
|
+
invocation = {
|
|
38
|
+
"phase": phase,
|
|
39
|
+
"hook_event": hook,
|
|
40
|
+
"provenance": "harness_reported",
|
|
41
|
+
}
|
|
42
|
+
identifier = raw.get("id")
|
|
43
|
+
if (
|
|
44
|
+
isinstance(identifier, str)
|
|
45
|
+
and 0 < len(identifier) <= MAX_INVOCATION_ID
|
|
46
|
+
and all("!" <= char <= "~" for char in identifier)
|
|
47
|
+
):
|
|
48
|
+
invocation["id"] = identifier
|
|
49
|
+
metadata: dict[str, Any] = {"invocation": invocation}
|
|
50
|
+
if phase == "request":
|
|
51
|
+
return metadata
|
|
52
|
+
raw_result = tool.get("result")
|
|
53
|
+
if not isinstance(raw_result, dict):
|
|
54
|
+
return {}
|
|
55
|
+
expected = "reported_failure" if hook == "PostToolUseFailure" else "reported_success"
|
|
56
|
+
if raw_result.get("status") != expected:
|
|
57
|
+
return {}
|
|
58
|
+
result: dict[str, Any] = {"status": expected}
|
|
59
|
+
duration = raw_result.get("duration_ms")
|
|
60
|
+
# bool is an int subclass. Strings and integral floats must not be coerced.
|
|
61
|
+
if type(duration) is int and 0 <= duration <= MAX_DURATION_MS:
|
|
62
|
+
result["duration_ms"] = duration
|
|
63
|
+
if hook == "PostToolUseFailure":
|
|
64
|
+
interrupted = raw_result.get("is_interrupt")
|
|
65
|
+
if type(interrupted) is bool:
|
|
66
|
+
result["is_interrupt"] = interrupted
|
|
67
|
+
result["error_kind"] = "interrupted" if interrupted is True else "tool_failure"
|
|
68
|
+
metadata["result"] = result
|
|
69
|
+
return metadata
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def claude_hook_tool_metadata(hook: str, data: dict[str, Any]) -> dict[str, Any]:
|
|
73
|
+
"""Extract documented source scalars before arguments are hashed away."""
|
|
74
|
+
if hook not in _PHASES:
|
|
75
|
+
return {}
|
|
76
|
+
tool: dict[str, Any] = {
|
|
77
|
+
"invocation": {
|
|
78
|
+
"id": data.get("tool_use_id"),
|
|
79
|
+
"phase": _PHASES[hook],
|
|
80
|
+
"hook_event": hook,
|
|
81
|
+
"provenance": "harness_reported",
|
|
82
|
+
},
|
|
83
|
+
}
|
|
84
|
+
if _PHASES[hook] == "result":
|
|
85
|
+
tool["result"] = {
|
|
86
|
+
"status": "reported_failure" if hook == "PostToolUseFailure" else "reported_success",
|
|
87
|
+
"duration_ms": data.get("duration_ms"),
|
|
88
|
+
"is_interrupt": data.get("is_interrupt"),
|
|
89
|
+
}
|
|
90
|
+
return normalize_claude_tool_metadata(tool)
|
|
@@ -6,6 +6,7 @@ from typing import Any
|
|
|
6
6
|
|
|
7
7
|
from .loader import load_tool_policy
|
|
8
8
|
from .models import ToolPolicyMatch, ToolPolicyRule, ToolPolicyVerdict
|
|
9
|
+
from .shell_writes import literal_write_targets
|
|
9
10
|
# Not core.config, for the same reason as the DLP scanner (#171).
|
|
10
11
|
from ..policy_settings import policy_settings
|
|
11
12
|
|
|
@@ -132,6 +133,14 @@ def _rule_matches(rule: ToolPolicyRule, qualified: str, server: str, command: st
|
|
|
132
133
|
return False
|
|
133
134
|
if not _server_matches(rule, server):
|
|
134
135
|
return False
|
|
136
|
+
if rule.shell_write_pattern:
|
|
137
|
+
try:
|
|
138
|
+
if not any(re.search(rule.shell_write_pattern, target)
|
|
139
|
+
for target in literal_write_targets(command)):
|
|
140
|
+
return False
|
|
141
|
+
except re.error as exc:
|
|
142
|
+
logger.warning("[tool_policy] invalid write-target regex for rule %s: %s", rule.id, exc)
|
|
143
|
+
return False
|
|
135
144
|
if rule.command_pattern:
|
|
136
145
|
if not command:
|
|
137
146
|
return False
|
|
@@ -15,6 +15,13 @@ SAFE_LOADER = getattr(yaml, "CSafeLoader", yaml.SafeLoader)
|
|
|
15
15
|
|
|
16
16
|
ACTIONS = ("allow", "deny", "ask")
|
|
17
17
|
|
|
18
|
+
#: Rule keys this version reads. A key it does not know is ignored, so a rule
|
|
19
|
+
#: written for a newer sensor can match more than its author meant here: a rule
|
|
20
|
+
#: whose only matcher is an unknown key becomes "every call to these tools".
|
|
21
|
+
RULE_KEYS = frozenset(
|
|
22
|
+
{"id", "action", "description", "tools", "servers", "command_pattern", "shell_write_pattern"}
|
|
23
|
+
)
|
|
24
|
+
|
|
18
25
|
#: `ask` is not a valid default yet. "Ask about everything not allowlisted" is
|
|
19
26
|
#: zero-trust mode, and it needs the ask-gate's timeouts to be safe: an IDE
|
|
20
27
|
#: that never shows the prompt would otherwise stall every tool call forever.
|
|
@@ -62,6 +69,15 @@ def load_tool_policy(manifest_path: Path | str) -> tuple[list[ToolPolicyRule], s
|
|
|
62
69
|
|
|
63
70
|
rules: list[ToolPolicyRule] = []
|
|
64
71
|
for raw in data["rules"]:
|
|
72
|
+
unknown = sorted(str(key) for key in raw if key not in RULE_KEYS)
|
|
73
|
+
if unknown:
|
|
74
|
+
logger.warning(
|
|
75
|
+
"[tool_policy] rule %r has key(s) this version does not read: %s. "
|
|
76
|
+
"The rule is loaded without them, so it may match more than intended; "
|
|
77
|
+
"check that the manifest was written for this Agentmetry version",
|
|
78
|
+
raw.get("id", ""),
|
|
79
|
+
", ".join(unknown),
|
|
80
|
+
)
|
|
65
81
|
action = str(raw.get("action", "deny")).strip().lower()
|
|
66
82
|
if action not in ACTIONS:
|
|
67
83
|
logger.warning(
|
|
@@ -84,6 +100,7 @@ def load_tool_policy(manifest_path: Path | str) -> tuple[list[ToolPolicyRule], s
|
|
|
84
100
|
command_pattern=str(raw.get("command_pattern", "") or ""),
|
|
85
101
|
servers=[str(s) for s in servers],
|
|
86
102
|
description=str(raw.get("description", "") or ""),
|
|
103
|
+
shell_write_pattern=str(raw.get("shell_write_pattern", "") or ""),
|
|
87
104
|
)
|
|
88
105
|
)
|
|
89
106
|
return rules, default
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"""Recognize literal destinations of common shell writes without running commands.
|
|
2
|
+
|
|
3
|
+
This is deliberately a narrow policy helper, not a shell interpreter. It does
|
|
4
|
+
not resolve variables, cwd changes, aliases, subprocesses or arbitrary programs.
|
|
5
|
+
Quoted prose stays data. Python support reads literal AST arguments only.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import ast
|
|
11
|
+
import shlex
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _unquote(word: str) -> str:
|
|
15
|
+
if len(word) >= 2 and word[0] == word[-1] and word[0] in "\"'":
|
|
16
|
+
return word[1:-1]
|
|
17
|
+
return word
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _python_path(node: ast.AST) -> str | None:
|
|
21
|
+
if isinstance(node, ast.Constant) and isinstance(node.value, str):
|
|
22
|
+
return node.value
|
|
23
|
+
if isinstance(node, ast.Call) and node.args:
|
|
24
|
+
name = (
|
|
25
|
+
node.func.id
|
|
26
|
+
if isinstance(node.func, ast.Name)
|
|
27
|
+
else (node.func.attr if isinstance(node.func, ast.Attribute) else "")
|
|
28
|
+
)
|
|
29
|
+
if name in {"Path", "PurePath", "PosixPath", "WindowsPath"}:
|
|
30
|
+
return _python_path(node.args[0])
|
|
31
|
+
return None
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _python_writes(program: str) -> list[str]:
|
|
35
|
+
# The literal program is evidence to inspect, never code to execute. Bound
|
|
36
|
+
# AST work separately from the hook's command classification budget.
|
|
37
|
+
if len(program) > 16_384:
|
|
38
|
+
return []
|
|
39
|
+
try:
|
|
40
|
+
tree = ast.parse(program)
|
|
41
|
+
except (SyntaxError, RecursionError, ValueError):
|
|
42
|
+
return []
|
|
43
|
+
targets = []
|
|
44
|
+
for call in ast.walk(tree):
|
|
45
|
+
if not isinstance(call, ast.Call):
|
|
46
|
+
continue
|
|
47
|
+
method = call.func.attr if isinstance(call.func, ast.Attribute) else ""
|
|
48
|
+
name = call.func.id if isinstance(call.func, ast.Name) else method
|
|
49
|
+
path = None
|
|
50
|
+
if method in {"write_text", "write_bytes", "touch"}:
|
|
51
|
+
path = _python_path(call.func.value)
|
|
52
|
+
elif method == "unlink" and _python_path(call.func.value) is not None:
|
|
53
|
+
path = _python_path(call.func.value)
|
|
54
|
+
elif name == "open":
|
|
55
|
+
bound_path = (
|
|
56
|
+
_python_path(call.func.value) if isinstance(call.func, ast.Attribute) else None
|
|
57
|
+
)
|
|
58
|
+
mode = next((k.value for k in call.keywords if k.arg == "mode"), None)
|
|
59
|
+
if mode is None:
|
|
60
|
+
index = 0 if bound_path is not None else 1
|
|
61
|
+
mode = call.args[index] if len(call.args) > index else ast.Constant("r")
|
|
62
|
+
if (
|
|
63
|
+
isinstance(mode, ast.Constant)
|
|
64
|
+
and isinstance(mode.value, str)
|
|
65
|
+
and any(flag in mode.value for flag in "wax+")
|
|
66
|
+
):
|
|
67
|
+
if bound_path is not None:
|
|
68
|
+
path = bound_path
|
|
69
|
+
elif call.args:
|
|
70
|
+
path = _python_path(call.args[0])
|
|
71
|
+
elif method in {"remove", "rmtree", "unlink", "rename", "replace"} and call.args:
|
|
72
|
+
path = _python_path(call.args[0])
|
|
73
|
+
if path is not None:
|
|
74
|
+
targets.append(path)
|
|
75
|
+
return targets
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def _command_writes(words: list[str]) -> list[str]:
|
|
79
|
+
if not words:
|
|
80
|
+
return []
|
|
81
|
+
# Quotes around a command word can execute too. Do not inspect the argument
|
|
82
|
+
# of echo, printf or git commit as if it were another executable.
|
|
83
|
+
verb = _unquote(words[0]).replace("\\", "/").rsplit("/", 1)[-1].lower()
|
|
84
|
+
args = [_unquote(word) for word in words[1:]]
|
|
85
|
+
operands = [word for word in args if not word.startswith("-")]
|
|
86
|
+
if verb in {"rm", "unlink", "rmdir", "tee", "truncate", "touch", "mv"}:
|
|
87
|
+
return operands
|
|
88
|
+
if verb in {"cp", "install"}:
|
|
89
|
+
return operands[-1:]
|
|
90
|
+
if verb == "sed" and any(
|
|
91
|
+
word == "--in-place" or word.startswith("-i") or word.startswith("--in-place=")
|
|
92
|
+
for word in args
|
|
93
|
+
):
|
|
94
|
+
files = []
|
|
95
|
+
has_script = False
|
|
96
|
+
skip = False
|
|
97
|
+
for word in args:
|
|
98
|
+
if skip:
|
|
99
|
+
skip = False
|
|
100
|
+
continue
|
|
101
|
+
if word in {"-e", "--expression", "-f", "--file"}:
|
|
102
|
+
has_script, skip = True, True
|
|
103
|
+
elif word.startswith(("--expression=", "--file=", "-e", "-f")):
|
|
104
|
+
has_script = True
|
|
105
|
+
elif not word.startswith("-"):
|
|
106
|
+
files.append(word)
|
|
107
|
+
return files if has_script else files[1:]
|
|
108
|
+
if verb in {"python", "python3", "python.exe", "python3.exe"} and "-c" in args:
|
|
109
|
+
index = args.index("-c") + 1
|
|
110
|
+
return _python_writes(args[index]) if index < len(args) else []
|
|
111
|
+
return []
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
_WORD_BREAKS = " \t\r\n;&|<>()"
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def _strip_comments(command: str) -> str:
|
|
118
|
+
"""Remove what Bash treats as a comment: `#` at the start of a word, outside quotes.
|
|
119
|
+
|
|
120
|
+
shlex starts a comment at any `#`, so `x=a#b; echo {} > file` lost the rest
|
|
121
|
+
of the line, write included. A `#` inside a word, as in `$#`, a URL fragment
|
|
122
|
+
or an assignment, is a literal in Bash and stays one here. A comment runs to
|
|
123
|
+
the end of its line; the newline is kept, so the next line is still a new
|
|
124
|
+
command.
|
|
125
|
+
"""
|
|
126
|
+
out: list[str] = []
|
|
127
|
+
quote = ""
|
|
128
|
+
word_start = True
|
|
129
|
+
index = 0
|
|
130
|
+
while index < len(command):
|
|
131
|
+
char = command[index]
|
|
132
|
+
if quote:
|
|
133
|
+
out.append(char)
|
|
134
|
+
if char == "\\" and quote == '"' and index + 1 < len(command):
|
|
135
|
+
out.append(command[index + 1])
|
|
136
|
+
index += 1
|
|
137
|
+
elif char == quote:
|
|
138
|
+
quote = ""
|
|
139
|
+
word_start = False
|
|
140
|
+
elif char == "\\" and index + 1 < len(command):
|
|
141
|
+
out.append(command[index : index + 2])
|
|
142
|
+
index += 1
|
|
143
|
+
word_start = False
|
|
144
|
+
elif char == "#" and word_start:
|
|
145
|
+
end = command.find("\n", index)
|
|
146
|
+
if end == -1:
|
|
147
|
+
break
|
|
148
|
+
index = end
|
|
149
|
+
continue
|
|
150
|
+
else:
|
|
151
|
+
out.append(char)
|
|
152
|
+
if char in "'\"":
|
|
153
|
+
quote = char
|
|
154
|
+
word_start = char in _WORD_BREAKS
|
|
155
|
+
index += 1
|
|
156
|
+
return "".join(out)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def literal_write_targets(command: str) -> list[str]:
|
|
160
|
+
"""Literal write/remove operands and output redirections in common commands.
|
|
161
|
+
|
|
162
|
+
Non-POSIX mode preserves quotes, so `echo '> file'` cannot become a shell
|
|
163
|
+
redirect. This intentionally does not claim to normalize shell syntax.
|
|
164
|
+
"""
|
|
165
|
+
lexer = shlex.shlex(_strip_comments(command), posix=False, punctuation_chars=";&|<>()\n")
|
|
166
|
+
lexer.whitespace = " \t\r"
|
|
167
|
+
lexer.whitespace_split = True
|
|
168
|
+
# Comments were removed the way Bash reads them; shlex's own rule is wrong.
|
|
169
|
+
lexer.commenters = ""
|
|
170
|
+
try:
|
|
171
|
+
tokens = list(lexer)
|
|
172
|
+
except ValueError:
|
|
173
|
+
return []
|
|
174
|
+
targets = []
|
|
175
|
+
words: list[str] = []
|
|
176
|
+
index = 0
|
|
177
|
+
while index < len(tokens):
|
|
178
|
+
word = tokens[index]
|
|
179
|
+
if word in {">", ">>", ">|", "&>"} and index + 1 < len(tokens):
|
|
180
|
+
targets.append(_unquote(tokens[index + 1]))
|
|
181
|
+
index += 2
|
|
182
|
+
continue
|
|
183
|
+
if word and all(char in ";&|()\n" for char in word):
|
|
184
|
+
targets.extend(_command_writes(words))
|
|
185
|
+
words = []
|
|
186
|
+
else:
|
|
187
|
+
words.append(word)
|
|
188
|
+
index += 1
|
|
189
|
+
targets.extend(_command_writes(words))
|
|
190
|
+
return targets
|
|
@@ -90,7 +90,7 @@ def snapshot() -> dict[str, Any]:
|
|
|
90
90
|
"action": rule.action,
|
|
91
91
|
"description": rule.description,
|
|
92
92
|
"tools": len(rule.tools),
|
|
93
|
-
"matches_command": bool(rule.command_pattern),
|
|
93
|
+
"matches_command": bool(rule.command_pattern or rule.shell_write_pattern),
|
|
94
94
|
}
|
|
95
95
|
for rule in rules
|
|
96
96
|
],
|