agentmetry 0.10.6__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.10.6 → agentmetry-0.12.0}/Dockerfile +5 -2
- {agentmetry-0.10.6 → agentmetry-0.12.0}/PKG-INFO +7 -7
- {agentmetry-0.10.6 → agentmetry-0.12.0}/README.md +5 -5
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/api/routes/audit.py +92 -4
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/cli/__init__.py +3 -0
- agentmetry-0.12.0/agentmetry/core/account.py +367 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/adapters/chronicle.py +13 -0
- agentmetry-0.12.0/agentmetry/core/audit/detection/artifacts.py +140 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/live.py +8 -1
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/models.py +6 -1
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/external.py +27 -2
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/hook_bootstrap.py +1 -0
- agentmetry-0.12.0/agentmetry/core/audit/identity_view.py +238 -0
- agentmetry-0.12.0/agentmetry/core/audit/invocation.py +90 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/otel_ingest.py +6 -1
- agentmetry-0.12.0/agentmetry/core/audit/personal_domains.py +89 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/tool_policy/evaluator.py +9 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/tool_policy/loader.py +17 -0
- {agentmetry-0.10.6 → 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.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/trail_db.py +28 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/diagnostics/machine_view.py +1 -1
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/version.py +1 -1
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/404.html +1 -1
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/__next.__PAGE__.txt +5 -5
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/__next._full.txt +5 -5
- agentmetry-0.12.0/agentmetry/dashboard_static/__next._tree.txt +5 -0
- 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.10.6/agentmetry/dashboard_static/_next/static/chunks/3in77zrqn0wml.css → agentmetry-0.12.0/agentmetry/dashboard_static/_next/static/chunks/2c45lmylpxhfd.css +1 -1
- 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.10.6/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.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/_not-found/__next._full.txt +3 -3
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/_not-found/__next._not-found.__PAGE__.txt +3 -3
- agentmetry-0.12.0/agentmetry/dashboard_static/_not-found/__next._tree.txt +4 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/_not-found.html +1 -1
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/_not-found.txt +3 -3
- agentmetry-0.12.0/agentmetry/dashboard_static/index.html +1 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/index.txt +5 -5
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/hooks/ingest.py +43 -6
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/policies/tool/manifest.yaml +24 -5
- {agentmetry-0.10.6 → agentmetry-0.12.0}/pyproject.toml +1 -1
- agentmetry-0.12.0/tests/test_account_identity.py +322 -0
- 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_codex_account.py +450 -0
- agentmetry-0.12.0/tests/test_detection_artifacts.py +236 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_detection_duplicate_emission.py +22 -4
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_external_ingest.py +61 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_funding_manifest.py +2 -1
- agentmetry-0.12.0/tests/test_identity_view.py +273 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_ingest_roundtrip.py +100 -0
- agentmetry-0.12.0/tests/test_personal_domains.py +122 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_scanner.py +3 -1
- agentmetry-0.12.0/tests/test_supply_chain_boundaries.py +226 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_tool_policy_agent_cli.py +4 -4
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_version.py +11 -0
- agentmetry-0.10.6/agentmetry/dashboard_static/__next._tree.txt +0 -5
- agentmetry-0.10.6/agentmetry/dashboard_static/_next/static/chunks/0umf92h1sb77c.js +0 -1
- agentmetry-0.10.6/agentmetry/dashboard_static/_next/static/chunks/16sszuo8m5-lu.js +0 -4
- agentmetry-0.10.6/agentmetry/dashboard_static/_next/static/chunks/1q292q_rc4_p6.js +0 -22
- agentmetry-0.10.6/agentmetry/dashboard_static/_next/static/chunks/216iyidhmrh3u.js +0 -1
- agentmetry-0.10.6/agentmetry/dashboard_static/_next/static/chunks/31qp8jfkw0x2h.js +0 -31
- agentmetry-0.10.6/agentmetry/dashboard_static/_next/static/chunks/3ia-1961js2lo.js +0 -1
- agentmetry-0.10.6/agentmetry/dashboard_static/_not-found/__next._tree.txt +0 -4
- agentmetry-0.10.6/agentmetry/dashboard_static/index.html +0 -1
- {agentmetry-0.10.6 → agentmetry-0.12.0}/.dockerignore +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/.env.agentmetry-demo +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/.env.example +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/.gitignore +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/__init__.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/api/__init__.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/api/main.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/api/routes/__init__.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/api/routes/auth.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/api/trusted_host.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/api/websocket.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/api/ws_bridge.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/cli/__main__.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/__init__.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/api_token.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/__init__.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/adapters/__init__.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/adapters/agt.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/adapters/cloudevents.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/adapters/ecs.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/adapters/sentinel.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/adapters/splunk.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/alerts.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/antigravity_trajectory.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/atlas.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/canonical.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/cloud_bridge.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/compliance_digest.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/cursor_cloud_cache.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/__init__.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/benchmark.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_approval_denied_then_executed.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_arbitrary_host_stage_execute.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_autonomous_unapproved_write.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_credential_exfil.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_credential_then_cloud_api.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_destructive_delete_burst.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_discovery_then_collect.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_dotfile_then_git_push.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_encoded_command_download.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_env_credential_exfil.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_hashed_only_no_command.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_interpreter_egress.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_pr_merged_without_review.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_proc_substitution_cradle.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_remote_pipe_to_shell.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_remote_staging_then_execute.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_secret_manager_then_egress.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_session_tool_burst.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_single_command_exfil.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_single_quoted_interpreter_egress.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_ssh_directory_exfil.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_subagent_swarm.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_timestamp_collision.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/attack_untrusted_input_then_action.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_authoring_merge_fixtures.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_autonomous_after_approval.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_build_artifact_cleanup.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_ci_artifact_download.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_commit_message_names_cloud_clis.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_container_registry_publish.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_database_migration.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_dependency_audit_network_burst.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_dependency_install_and_build.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_download_release_archive.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_env_example_read.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_fetch_data_then_run_repo_script.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_fetch_dataset_then_analyse.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_fetch_lockfile_then_install.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_fetch_piped_into_own_script.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_git_review_and_push.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_github_raw_docs_then_script.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_human_driven_deletes.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_local_api_probing.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_long_but_calm_session.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_loopback_is_not_egress.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_loopback_pipe_to_interpreter.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_mcp_text_mentions_credential_path.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_ordinary_development.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_package_manager_after_fetch.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_reading_config_that_is_not_secret.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_remote_api_call_no_credentials.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_research_then_docs.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_reversed_order_is_not_exfil.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_secret_names_and_docs.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_terraform_apply_with_profile.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_test_and_fix_loop.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/benign_writing_about_credentials.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/corpus/corpus.yaml +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/disposition.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/engine.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/live_store.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/rules.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/traits.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/yaml_config.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/detection/yaml_rules.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/dlp/__init__.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/dlp/loader.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/dlp/models.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/dlp/scanner.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/dogfood.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/evidence_pack.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/forwarder.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/grok_bot_transcript.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/hashing.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/heartbeat.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/identity.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/ingest.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/ingest_quota.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/managed_hooks.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/mcp_inventory_event.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/migrate.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/mitre.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/policy.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/policy_settings.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/posture_event.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/redaction.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/replay.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/run_context.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/session_tree.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/signing.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/sinks.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/spool.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/tool_policy/__init__.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/tool_policy/capability.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/trail_anchor.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/trail_chain.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/trail_merkle.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/audit/trail_rotation.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/auth.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/bus/__init__.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/bus/audit_exporter.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/bus/bridges.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/bus/bus.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/bus/events.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/bus/outbox.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/config.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/dashboard_session.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/diagnostics/__init__.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/diagnostics/autostart.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/diagnostics/doctor.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/diagnostics/driver_paths.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/diagnostics/env_file.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/diagnostics/hook_coverage.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/diagnostics/mcp_inventory.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/diagnostics/mcp_schema.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/diagnostics/posture.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/drivers/__init__.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/drivers/host.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/drivers/permissions.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/drivers/spec.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/extensions.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/health.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/managed_policy.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/operator_identity.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/paths.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/scanner/__init__.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/scanner/injection.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/scanner/instruction_files.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/scanner/known_packages.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/scanner/scan.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/core/scanner/typosquat.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/.gitkeep +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/chunks/0cz1d0mv5g_q7.js +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/chunks/1ix59xuhq-q14.css +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/media/ibm-plex-mono-latin-400-normal.2lhng2ntocry9.woff +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/media/ibm-plex-mono-latin-400-normal.3xdfs0-p_zi4c.woff2 +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/media/ibm-plex-mono-latin-500-normal.11q3guvgd1r20.woff2 +0 -0
- {agentmetry-0.10.6 → 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.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/media/ibm-plex-sans-latin-400-normal.19i24--p24z3r.woff +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/media/ibm-plex-sans-latin-400-normal.1xf5nwxyfigak.woff2 +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/media/ibm-plex-sans-latin-500-normal.14sc3d7sk_zzh.woff +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/media/ibm-plex-sans-latin-500-normal.2i4a1iuj6lbvw.woff2 +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/media/ibm-plex-sans-latin-600-normal.2ovda_azncp9b.woff2 +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/_next/static/media/ibm-plex-sans-latin-600-normal.2wn5p1s7u3utm.woff +0 -0
- {agentmetry-0.10.6/agentmetry/dashboard_static/_next/static/J0aKlqH-KWdyNe48Kd-3V → agentmetry-0.12.0/agentmetry/dashboard_static/_next/static/oPjtzGxzqOqWdv6GOzeru}/_buildManifest.js +0 -0
- {agentmetry-0.10.6/agentmetry/dashboard_static/_next/static/J0aKlqH-KWdyNe48Kd-3V → agentmetry-0.12.0/agentmetry/dashboard_static/_next/static/oPjtzGxzqOqWdv6GOzeru}/_clientMiddlewareManifest.js +0 -0
- {agentmetry-0.10.6/agentmetry/dashboard_static/_next/static/J0aKlqH-KWdyNe48Kd-3V → agentmetry-0.12.0/agentmetry/dashboard_static/_next/static/oPjtzGxzqOqWdv6GOzeru}/_ssgManifest.js +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/dashboard_static/agentmetry-icon-white.svg +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/demo.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/hooks/__init__.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/hooks/mcp_proxy.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/policies/detection/manifest.yaml +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/policies/dlp/manifest.yaml +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/agentmetry/policies/opa/agent_rules.rego +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/conftest.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/fixtures/agt_filesink_exfil.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/fixtures/agt_filesink_mixed.jsonl +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/fixtures/codex_hooks/README.md +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/fixtures/codex_hooks/permission-request.command.output.schema.json +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/fixtures/codex_hooks/pre-tool-use.command.output.schema.json +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/fixtures/fake_mcp_server.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/fixtures/otel_claude_code_session.json +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/fixtures/scanner/benign_skill/SKILL.md +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/fixtures/scanner/benign_tools.json +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/fixtures/scanner/poisoned_skill/SKILL.md +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/fixtures/scanner/poisoned_tools.json +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_agentmetry_audit.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_agentmetry_ingest_client.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_agt_adapter.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_antigravity_trajectory.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_ask_gate_phase_a.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_atlas_detection_enrichment.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_atlas_mapping.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_audit_sinks.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_audit_stats.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_audit_tail.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_auth.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_auth_default.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_autostart.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_boot_sequence.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_burst_windows.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_chinese_agent_hooks.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_chinese_agent_sprint_b.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_chinese_agent_sprint_c.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_chronicle_adapter.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_classification_bounds.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_cli_backup.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_cli_commands.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_cli_env_var_names.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_cloud_bridge.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_cloudevents_adapter.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_codex_windows_command.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_compliance_digest.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_container_and_legacy_runtime.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_copilot_hooks.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_coverage_observed.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_crewai_adapter.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_cursor_cloud_cache.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_demo.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_demo_isolation.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_demo_mode_flag.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_detection_adi.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_detection_benchmark.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_detection_default_config.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_detection_disposition.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_detection_disposition_api.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_detection_emit_durability.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_detection_engine.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_detection_evasion.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_detection_hf_incident.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_detection_quoted_command_words.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_detection_rule_identity.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_detection_rules_v2.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_dlp_agent_env_override.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_dlp_invisible_unicode.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_dlp_markdown_exfil.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_dlp_scanner.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_doctor.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_doctor_first_run.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_doctor_json_and_remediation.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_dogfood.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_dogfood_freeze.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_driver_paths.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_ecs_threat.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_event_bus.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_event_signing.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_evidence_pack.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_extensions.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_fail_closed_partial.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_forwarder.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_forwarding_shape.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_grok_bot_transcript.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_hash_key.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_heartbeat.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_hook_bootstrap.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_hook_coverage.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_hook_decision_format.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_hook_enforcement_timing.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_hook_import_cost.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_hook_real_process.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_hook_spool.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_identity_enrich.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_identity_provider.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_ingest_rate_limit.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_ingest_token.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_isolation.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_launch_targets.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_live_detection.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_live_detection_store.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_machine_view.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_managed_hooks.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_managed_policy.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_mcp_audit_proxy.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_mcp_concealed_text.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_mcp_inventory.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_mcp_inventory_event.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_mcp_meta_fingerprint.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_mcp_proxy_packaged.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_mcp_schema.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_mitre_dlp.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_opensre_adapter.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_operator_attribution.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_otel_ingest.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_paths.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_posture.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_powershell_encoding.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_readme_claims.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_redaction.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_replay.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_sentinel.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_serve_script_binds_loopback.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_session_tree.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_shared_install.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_sigma_pack.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_static_serving.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_subagent_lifecycle.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_suite_leaves_real_home_alone.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_tool_policy.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_tool_policy_git_hooks.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_trail_anchor.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_trail_chain.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_trail_concurrency.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_trail_merkle.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_transcript_watcher.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_trusted_host.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_unattended_agent_policy.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_user_profile_dir.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tests/test_yaml_detection_rules.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tools/generate_sigma_pack.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tools/mcp_audit_proxy.py +0 -0
- {agentmetry-0.10.6 → agentmetry-0.12.0}/tools/vault_fs_server.py +0 -0
|
@@ -6,8 +6,11 @@
|
|
|
6
6
|
# It used to start `uvicorn api.main:app`, a module path that has not existed
|
|
7
7
|
# since the package became `agentmetry`, so the image could not boot. It also
|
|
8
8
|
# installed gcc and libpq for a Postgres the recorder no longer uses.
|
|
9
|
+
#
|
|
10
|
+
# Base images are pinned by digest, because a tag can be moved to other content
|
|
11
|
+
# after the fact. Dependabot bumps the digests.
|
|
9
12
|
|
|
10
|
-
FROM node:20-alpine AS dashboard
|
|
13
|
+
FROM node:20-alpine@sha256:fb4cd12c85ee03686f6af5362a0b0d56d50c58a04632e6c0fb8363f609372293 AS dashboard
|
|
11
14
|
WORKDIR /dashboard
|
|
12
15
|
COPY apps/dashboard/package.json apps/dashboard/package-lock.json ./
|
|
13
16
|
RUN npm ci
|
|
@@ -17,7 +20,7 @@ COPY apps/dashboard/ ./
|
|
|
17
20
|
ENV NEXT_PUBLIC_SAME_ORIGIN=true
|
|
18
21
|
RUN npm run build
|
|
19
22
|
|
|
20
|
-
FROM python:3.12-slim
|
|
23
|
+
FROM python:3.12-slim@sha256:5e2bdb1b0d542d5039cffb8181c65930093949194a65c365dfb1b0fe13a4fa5b
|
|
21
24
|
WORKDIR /app
|
|
22
25
|
|
|
23
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,18 +37,18 @@ 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
|
|
44
44
|
|
|
45
45
|
A local-first endpoint sensor for AI coding agents.
|
|
46
46
|
|
|
47
|
-
Agentmetry
|
|
48
|
-
Antigravity, Qwen, Kimi, Qoder and CodeBuddy,
|
|
49
|
-
|
|
50
|
-
over the session. A credential read followed
|
|
51
|
-
|
|
47
|
+
Agentmetry records events reported by supported hooks for Claude Code, Cursor,
|
|
48
|
+
Codex, GitHub Copilot, Antigravity, Qwen, Kimi, Qoder and CodeBuddy, and by wrapped
|
|
49
|
+
stdio MCP servers. It writes those events to a hash-chained JSONL trail on your
|
|
50
|
+
machine and runs sequence detection over the session. A credential read followed
|
|
51
|
+
by network egress can trigger a finding. Findings carry MITRE ATT&CK labels, and
|
|
52
52
|
MITRE ATLAS labels where ATLAS says something ATT&CK cannot.
|
|
53
53
|
|
|
54
54
|
Nothing leaves the machine unless you configure it, and there is no telemetry.
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
A local-first endpoint sensor for AI coding agents.
|
|
4
4
|
|
|
5
|
-
Agentmetry
|
|
6
|
-
Antigravity, Qwen, Kimi, Qoder and CodeBuddy,
|
|
7
|
-
|
|
8
|
-
over the session. A credential read followed
|
|
9
|
-
|
|
5
|
+
Agentmetry records events reported by supported hooks for Claude Code, Cursor,
|
|
6
|
+
Codex, GitHub Copilot, Antigravity, Qwen, Kimi, Qoder and CodeBuddy, and by wrapped
|
|
7
|
+
stdio MCP servers. It writes those events to a hash-chained JSONL trail on your
|
|
8
|
+
machine and runs sequence detection over the session. A credential read followed
|
|
9
|
+
by network egress can trigger a finding. Findings carry MITRE ATT&CK labels, and
|
|
10
10
|
MITRE ATLAS labels where ATLAS says something ATT&CK cannot.
|
|
11
11
|
|
|
12
12
|
Nothing leaves the machine unless you configure it, and there is no telemetry.
|
|
@@ -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
|
|
@@ -92,6 +122,39 @@ class IngestOperatorBody(BaseModel):
|
|
|
92
122
|
source: str = ""
|
|
93
123
|
|
|
94
124
|
|
|
125
|
+
class IngestModelBody(BaseModel):
|
|
126
|
+
"""The model a capture surface reports. A claim, not proof of what served it.
|
|
127
|
+
|
|
128
|
+
Wrong types become empty rather than failing validation: undeclared, this
|
|
129
|
+
field was ignored, and declaring it must not start refusing events. The
|
|
130
|
+
length bound is in external.py, because the spool replay skips this model.
|
|
131
|
+
"""
|
|
132
|
+
|
|
133
|
+
id: str = ""
|
|
134
|
+
provider: str = ""
|
|
135
|
+
|
|
136
|
+
@field_validator("id", "provider", mode="before")
|
|
137
|
+
@classmethod
|
|
138
|
+
def _text_or_empty(cls, v: Any) -> str:
|
|
139
|
+
return v if isinstance(v, str) else ""
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
class IngestAccountBody(BaseModel):
|
|
143
|
+
"""A bounded client-reported agent account claim, never verified identity."""
|
|
144
|
+
|
|
145
|
+
domain: str = ""
|
|
146
|
+
source: str = ""
|
|
147
|
+
organization_id: str = ""
|
|
148
|
+
email: str = ""
|
|
149
|
+
account_id: str = ""
|
|
150
|
+
user_id: str = ""
|
|
151
|
+
|
|
152
|
+
@field_validator("domain", "source", "organization_id", "email", "account_id", "user_id", mode="before")
|
|
153
|
+
@classmethod
|
|
154
|
+
def _text_or_empty(cls, v: Any) -> str:
|
|
155
|
+
return v if isinstance(v, str) else ""
|
|
156
|
+
|
|
157
|
+
|
|
95
158
|
class ExternalIngestBody(BaseModel):
|
|
96
159
|
"""Adapter payload — normalized to canonical v1.2 on ingest.
|
|
97
160
|
|
|
@@ -104,9 +167,10 @@ class ExternalIngestBody(BaseModel):
|
|
|
104
167
|
MCP per-tool digests and the initialize handshake, and those were dropped
|
|
105
168
|
too, so the release headline did not survive the wire. Then 0.10.4's
|
|
106
169
|
`tool.classification` and 0.9.3's HMAC label went the same way, because the
|
|
107
|
-
roundtrip test covered the proxy's builders and not the hook's.
|
|
108
|
-
`
|
|
109
|
-
|
|
170
|
+
roundtrip test covered the proxy's builders and not the hook's. Then #389:
|
|
171
|
+
Codex's `model`, because that test ran only the Claude mapper, which sends
|
|
172
|
+
none. `test_ingest_roundtrip.py` now builds all of these and fails if any
|
|
173
|
+
key does not survive this model.
|
|
110
174
|
"""
|
|
111
175
|
|
|
112
176
|
source_app: str = Field(
|
|
@@ -126,6 +190,10 @@ class ExternalIngestBody(BaseModel):
|
|
|
126
190
|
tool: IngestToolBody | None = None
|
|
127
191
|
input_hash: str = ""
|
|
128
192
|
model_id: str = ""
|
|
193
|
+
model: IngestModelBody | None = None
|
|
194
|
+
# Account metadata is additive and optional. external.py validates and
|
|
195
|
+
# bounds it again because spool replay bypasses this HTTP model.
|
|
196
|
+
account: IngestAccountBody | None = None
|
|
129
197
|
adapter: str = ""
|
|
130
198
|
triggered_by: str = "manual"
|
|
131
199
|
timestamp_utc: str = ""
|
|
@@ -157,6 +225,11 @@ class ExternalIngestBody(BaseModel):
|
|
|
157
225
|
server_version: str = ""
|
|
158
226
|
list_changed: bool | None = None
|
|
159
227
|
|
|
228
|
+
@field_validator("model", mode="before")
|
|
229
|
+
@classmethod
|
|
230
|
+
def _model_object_or_none(cls, v: Any) -> Any:
|
|
231
|
+
return v if isinstance(v, dict) else None
|
|
232
|
+
|
|
160
233
|
|
|
161
234
|
def _parse_event_ts(event: dict[str, Any]) -> datetime | None:
|
|
162
235
|
ts = event.get("timestamp_utc")
|
|
@@ -537,6 +610,21 @@ async def machine_view():
|
|
|
537
610
|
return await asyncio.to_thread(snapshot)
|
|
538
611
|
|
|
539
612
|
|
|
613
|
+
@router.get("/identity", dependencies=[Depends(require_api_key)])
|
|
614
|
+
async def identity_view(days: int = Query(30, ge=1, le=90)):
|
|
615
|
+
"""Which accounts agents reported, for the dashboard's Identity page.
|
|
616
|
+
|
|
617
|
+
Read-only. These are client claims read back from the trail, and an agent
|
|
618
|
+
that reported nothing is listed as unknown rather than left out.
|
|
619
|
+
"""
|
|
620
|
+
if not settings.audit_export_enabled:
|
|
621
|
+
return {"enabled": False, "window_days": days}
|
|
622
|
+
|
|
623
|
+
from agentmetry.core.audit.identity_view import identity_snapshot
|
|
624
|
+
|
|
625
|
+
return await asyncio.to_thread(identity_snapshot, days)
|
|
626
|
+
|
|
627
|
+
|
|
540
628
|
@router.get("/status", dependencies=[Depends(require_api_key)])
|
|
541
629
|
async def audit_status():
|
|
542
630
|
"""Freshness + per-source counts so the dashboard can show 'last event N min ago'.
|
|
@@ -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,367 @@
|
|
|
1
|
+
"""Validate and minimise the account identity a coding agent reports.
|
|
2
|
+
|
|
3
|
+
This module deliberately has no Agentmetry imports. Hook processes import it
|
|
4
|
+
before the receiver, and a malformed account claim must never break capture.
|
|
5
|
+
The value is a client claim, not proof of identity.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
import base64
|
|
11
|
+
import json
|
|
12
|
+
import os
|
|
13
|
+
import sys
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
from typing import Any
|
|
16
|
+
from urllib.parse import urlsplit
|
|
17
|
+
|
|
18
|
+
_EMAIL_MAX = 320
|
|
19
|
+
_DOMAIN_MAX = 253
|
|
20
|
+
_ORG_MAX = 256
|
|
21
|
+
_SOURCE_MAX = 32
|
|
22
|
+
_TRUE = frozenset({"1", "true", "yes", "on"})
|
|
23
|
+
_LOCAL_CONFIG_MAX_BYTES = 1024 * 1024
|
|
24
|
+
_ACCOUNT_ID_MAX = 128
|
|
25
|
+
_ACCOUNT_ID_CHARS = frozenset(
|
|
26
|
+
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_:."
|
|
27
|
+
)
|
|
28
|
+
#: The first line of a Codex session file also holds its base instructions.
|
|
29
|
+
_SESSION_META_MAX_BYTES = 1024 * 1024
|
|
30
|
+
_WINDOWS_EXTENDED_PREFIX = chr(92) * 2 + "?" + chr(92)
|
|
31
|
+
_CODEX_AUTH_MAX_BYTES = 256 * 1024
|
|
32
|
+
_CLAUDE_AUTH_OVERRIDE_VARS = (
|
|
33
|
+
"ANTHROPIC_API_KEY",
|
|
34
|
+
"ANTHROPIC_AUTH_TOKEN",
|
|
35
|
+
"CLAUDE_CODE_OAUTH_TOKEN",
|
|
36
|
+
"ANTHROPIC_PROFILE",
|
|
37
|
+
)
|
|
38
|
+
_CLAUDE_PROVIDER_FLAGS = (
|
|
39
|
+
"CLAUDE_CODE_USE_BEDROCK",
|
|
40
|
+
"CLAUDE_CODE_USE_VERTEX",
|
|
41
|
+
"CLAUDE_CODE_USE_FOUNDRY",
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def _clean_text(value: Any, limit: int) -> str:
|
|
46
|
+
if not isinstance(value, str):
|
|
47
|
+
return ""
|
|
48
|
+
value = value.strip()
|
|
49
|
+
if not value or len(value) > limit or any(ord(ch) < 32 or ord(ch) == 127 for ch in value):
|
|
50
|
+
return ""
|
|
51
|
+
return value
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def _valid_domain(domain: str) -> bool:
|
|
55
|
+
if not domain or len(domain) > _DOMAIN_MAX or domain.endswith("."):
|
|
56
|
+
return False
|
|
57
|
+
labels = domain.split(".")
|
|
58
|
+
return all(
|
|
59
|
+
label
|
|
60
|
+
and len(label) <= 63
|
|
61
|
+
and label[0].isalnum()
|
|
62
|
+
and label[-1].isalnum()
|
|
63
|
+
and all(ch.isalnum() or ch == "-" for ch in label)
|
|
64
|
+
for label in labels
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def account_from_email(
|
|
69
|
+
value: Any,
|
|
70
|
+
source: str,
|
|
71
|
+
organization_id: Any = "",
|
|
72
|
+
*,
|
|
73
|
+
include_email: bool | None = None,
|
|
74
|
+
) -> dict[str, str]:
|
|
75
|
+
"""Return a bounded account block, or an empty block for bad input."""
|
|
76
|
+
raw = _clean_text(value, _EMAIL_MAX)
|
|
77
|
+
if raw.count("@") != 1:
|
|
78
|
+
return {}
|
|
79
|
+
local, domain = raw.rsplit("@", 1)
|
|
80
|
+
if not local or any(ch.isspace() for ch in raw):
|
|
81
|
+
return {}
|
|
82
|
+
domain = domain.lower()
|
|
83
|
+
if not _valid_domain(domain):
|
|
84
|
+
return {}
|
|
85
|
+
|
|
86
|
+
source_text = _clean_text(source, _SOURCE_MAX).lower()
|
|
87
|
+
if not source_text:
|
|
88
|
+
source_text = "client"
|
|
89
|
+
org = _clean_text(organization_id, _ORG_MAX)
|
|
90
|
+
block = {"domain": domain, "source": source_text}
|
|
91
|
+
if org:
|
|
92
|
+
block["organization_id"] = org
|
|
93
|
+
if include_email is None:
|
|
94
|
+
include_email = os.environ.get("AGENTMETRY_LOG_ACCOUNT_EMAIL", "").strip().lower() in _TRUE
|
|
95
|
+
if include_email:
|
|
96
|
+
# Keep the local part as reported, but normalise the domain.
|
|
97
|
+
block["email"] = f"{local}@{domain}"
|
|
98
|
+
return block
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def account_from_domain(
|
|
102
|
+
domain: Any,
|
|
103
|
+
source: Any,
|
|
104
|
+
organization_id: Any = "",
|
|
105
|
+
email: Any = "",
|
|
106
|
+
*,
|
|
107
|
+
include_email: bool | None = None,
|
|
108
|
+
) -> dict[str, str]:
|
|
109
|
+
"""Validate an already-minimised claim, optionally retaining opt-in email."""
|
|
110
|
+
clean_domain = _clean_text(domain, _DOMAIN_MAX).lower()
|
|
111
|
+
if not _valid_domain(clean_domain):
|
|
112
|
+
return {}
|
|
113
|
+
source_text = _clean_text(source, _SOURCE_MAX).lower() or "client"
|
|
114
|
+
org = _clean_text(organization_id, _ORG_MAX)
|
|
115
|
+
block = {"domain": clean_domain, "source": source_text}
|
|
116
|
+
if org:
|
|
117
|
+
block["organization_id"] = org
|
|
118
|
+
if include_email is None:
|
|
119
|
+
include_email = os.environ.get("AGENTMETRY_LOG_ACCOUNT_EMAIL", "").strip().lower() in _TRUE
|
|
120
|
+
if include_email:
|
|
121
|
+
candidate = account_from_email(email, source_text, org, include_email=True)
|
|
122
|
+
if candidate and candidate.get("domain") == clean_domain:
|
|
123
|
+
block["email"] = candidate["email"]
|
|
124
|
+
return block
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def account_from_organization(organization_id: Any, source: str) -> dict[str, str]:
|
|
128
|
+
"""Return an organization-only claim when no email was reported."""
|
|
129
|
+
org = _clean_text(organization_id, _ORG_MAX)
|
|
130
|
+
source_text = _clean_text(source, _SOURCE_MAX).lower() or "client"
|
|
131
|
+
return {"organization_id": org, "source": source_text} if org else {}
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
def _clean_id(value: Any) -> str:
|
|
135
|
+
text = _clean_text(value, _ACCOUNT_ID_MAX)
|
|
136
|
+
return text if text and all(ch in _ACCOUNT_ID_CHARS for ch in text) else ""
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def account_from_ids(account_id: Any, user_id: Any, source: Any) -> dict[str, str]:
|
|
140
|
+
"""Return a claim of opaque account IDs. It names no domain and no address."""
|
|
141
|
+
account = _clean_id(account_id)
|
|
142
|
+
user = _clean_id(user_id)
|
|
143
|
+
if not account and not user:
|
|
144
|
+
return {}
|
|
145
|
+
block = {"source": _clean_text(source, _SOURCE_MAX).lower() or "client"}
|
|
146
|
+
if account:
|
|
147
|
+
block["account_id"] = account
|
|
148
|
+
if user:
|
|
149
|
+
block["user_id"] = user
|
|
150
|
+
return block
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def account_from_claim(
|
|
154
|
+
domain: Any,
|
|
155
|
+
source: Any,
|
|
156
|
+
organization_id: Any = "",
|
|
157
|
+
email: Any = "",
|
|
158
|
+
*,
|
|
159
|
+
account_id: Any = "",
|
|
160
|
+
user_id: Any = "",
|
|
161
|
+
include_email: bool | None = None,
|
|
162
|
+
) -> dict[str, str]:
|
|
163
|
+
"""Keep whichever valid parts of a claim arrived: domain, organization or IDs."""
|
|
164
|
+
account = account_from_domain(
|
|
165
|
+
domain, source, organization_id, email, include_email=include_email
|
|
166
|
+
) or account_from_organization(organization_id, source)
|
|
167
|
+
ids = account_from_ids(account_id, user_id, source)
|
|
168
|
+
return {**ids, **account} if account else ids
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def _claude_auth_override_present() -> bool:
|
|
172
|
+
"""Return whether visible environment state selects non-subscription auth."""
|
|
173
|
+
if any(os.environ.get(name, "").strip() for name in _CLAUDE_AUTH_OVERRIDE_VARS):
|
|
174
|
+
return True
|
|
175
|
+
if any(os.environ.get(name, "").strip().lower() in _TRUE for name in _CLAUDE_PROVIDER_FLAGS):
|
|
176
|
+
return True
|
|
177
|
+
if os.environ.get("ANTHROPIC_FEDERATION_RULE_ID", "").strip() and os.environ.get(
|
|
178
|
+
"ANTHROPIC_ORGANIZATION_ID", ""
|
|
179
|
+
).strip():
|
|
180
|
+
return True
|
|
181
|
+
base_url = os.environ.get("ANTHROPIC_BASE_URL", "").strip()
|
|
182
|
+
if base_url:
|
|
183
|
+
try:
|
|
184
|
+
hostname = urlsplit(base_url).hostname
|
|
185
|
+
except ValueError:
|
|
186
|
+
return True
|
|
187
|
+
if hostname != "api.anthropic.com":
|
|
188
|
+
return True
|
|
189
|
+
return False
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
def _local_claude_account() -> dict[str, str]:
|
|
193
|
+
"""Read two non-secret fields from Claude's undocumented local file.
|
|
194
|
+
|
|
195
|
+
The file and its JSON shape can change between Claude Code versions. It is
|
|
196
|
+
bounded and read once per short-lived hook invocation. An oversized file
|
|
197
|
+
is ignored rather than partially parsed. Explicit API credentials or a
|
|
198
|
+
custom endpoint take precedence over the signed-in account, so the local
|
|
199
|
+
fallback is skipped when any documented override is present.
|
|
200
|
+
"""
|
|
201
|
+
if _claude_auth_override_present():
|
|
202
|
+
return {}
|
|
203
|
+
try:
|
|
204
|
+
config_dir = os.environ.get("CLAUDE_CONFIG_DIR", "")
|
|
205
|
+
path = (Path(config_dir) if config_dir else Path.home()) / ".claude.json"
|
|
206
|
+
if not path.is_file() or path.stat().st_size > _LOCAL_CONFIG_MAX_BYTES:
|
|
207
|
+
return {}
|
|
208
|
+
parsed = json.loads(path.read_bytes())
|
|
209
|
+
oauth = parsed.get("oauthAccount") if isinstance(parsed, dict) else None
|
|
210
|
+
email = oauth.get("emailAddress") if isinstance(oauth, dict) else None
|
|
211
|
+
organization_id = oauth.get("organizationUuid") if isinstance(oauth, dict) else None
|
|
212
|
+
if isinstance(email, str):
|
|
213
|
+
account = account_from_email(email, "local_config", organization_id)
|
|
214
|
+
if account:
|
|
215
|
+
return account
|
|
216
|
+
return account_from_organization(organization_id, "local_config")
|
|
217
|
+
except (OSError, UnicodeError, ValueError, TypeError):
|
|
218
|
+
return {}
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
def _antigravity_storage_path() -> Path:
|
|
222
|
+
if sys.platform == "win32":
|
|
223
|
+
base = os.environ.get("APPDATA", "")
|
|
224
|
+
return (Path(base) if base else Path.home() / "AppData" / "Roaming") / "Antigravity" / "app_storage.json"
|
|
225
|
+
if sys.platform == "darwin":
|
|
226
|
+
return Path.home() / "Library" / "Application Support" / "Antigravity" / "app_storage.json"
|
|
227
|
+
base = os.environ.get("XDG_CONFIG_HOME", "")
|
|
228
|
+
return (Path(base) if base else Path.home() / ".config") / "Antigravity" / "app_storage.json"
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
def _local_antigravity_account() -> dict[str, str]:
|
|
232
|
+
"""Read the last sign-in name from Antigravity's undocumented app storage.
|
|
233
|
+
|
|
234
|
+
Its hook input has no account field. This one key names the account last
|
|
235
|
+
signed in on the machine, not necessarily the one that made the call, and
|
|
236
|
+
the key can change between versions. This file holds no credentials.
|
|
237
|
+
"""
|
|
238
|
+
try:
|
|
239
|
+
path = _antigravity_storage_path()
|
|
240
|
+
if not path.is_file() or path.stat().st_size > _LOCAL_CONFIG_MAX_BYTES:
|
|
241
|
+
return {}
|
|
242
|
+
parsed = json.loads(path.read_bytes())
|
|
243
|
+
if not isinstance(parsed, dict):
|
|
244
|
+
return {}
|
|
245
|
+
return account_from_email(parsed.get("jetski.onboarding.lastLoginUsername"), "local_config")
|
|
246
|
+
except (OSError, UnicodeError, ValueError, TypeError):
|
|
247
|
+
return {}
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
def _codex_home() -> Path:
|
|
251
|
+
configured = os.environ.get("CODEX_HOME", "").strip()
|
|
252
|
+
return (Path(configured) if configured else Path.home() / ".codex").resolve()
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
def _codex_auth_account() -> dict[str, str]:
|
|
256
|
+
"""Take the email domain from the identity token in Codex's `auth.json`.
|
|
257
|
+
|
|
258
|
+
This file holds live credentials, so the handling is deliberately narrow.
|
|
259
|
+
Only the `email` claim of `id_token` is used and the domain is all that is
|
|
260
|
+
kept. Nothing else in the file is copied, stored, logged or sent, and an
|
|
261
|
+
error here carries no content from it. The token's signature is not checked,
|
|
262
|
+
so this is what the file says, not proof of who made a call. It stops on an
|
|
263
|
+
API-key sign-in.
|
|
264
|
+
|
|
265
|
+
Off unless AGENTMETRY_CODEX_AUTH_DOMAIN=1. A sensor should not load a file of
|
|
266
|
+
live credentials on every tool call unless it was asked to, and endpoint
|
|
267
|
+
security tools may flag the read.
|
|
268
|
+
"""
|
|
269
|
+
if os.environ.get("AGENTMETRY_CODEX_AUTH_DOMAIN", "").strip().lower() not in _TRUE:
|
|
270
|
+
return {}
|
|
271
|
+
try:
|
|
272
|
+
path = _codex_home() / "auth.json"
|
|
273
|
+
if not path.is_file() or path.stat().st_size > _CODEX_AUTH_MAX_BYTES:
|
|
274
|
+
return {}
|
|
275
|
+
parsed = json.loads(path.read_bytes())
|
|
276
|
+
if not isinstance(parsed, dict) or parsed.get("auth_mode") != "chatgpt":
|
|
277
|
+
return {}
|
|
278
|
+
tokens = parsed.get("tokens")
|
|
279
|
+
id_token = tokens.get("id_token") if isinstance(tokens, dict) else None
|
|
280
|
+
if not isinstance(id_token, str) or id_token.count(".") != 2:
|
|
281
|
+
return {}
|
|
282
|
+
part = id_token.split(".")[1]
|
|
283
|
+
claims = json.loads(base64.urlsafe_b64decode(part + "=" * (-len(part) % 4)))
|
|
284
|
+
email = claims.get("email") if isinstance(claims, dict) else None
|
|
285
|
+
# This credential file has a stricter boundary than other sources:
|
|
286
|
+
# the global email opt-in must never retain its full email claim.
|
|
287
|
+
return account_from_email(email, "codex_auth", include_email=False)
|
|
288
|
+
except (OSError, UnicodeError, ValueError, TypeError, AttributeError):
|
|
289
|
+
return {}
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
def _codex_session_file(home: Path, transcript_path: Any, session_id: Any) -> Path | None:
|
|
293
|
+
"""Find the session file, from the path the hook named or else from its ID.
|
|
294
|
+
|
|
295
|
+
Windows tools can hand over the extended form of a path, which would not
|
|
296
|
+
match Codex's home. A session with no usable path is found by its ID, which
|
|
297
|
+
Codex puts in the file name.
|
|
298
|
+
"""
|
|
299
|
+
if isinstance(transcript_path, str) and transcript_path.endswith(".jsonl"):
|
|
300
|
+
text = transcript_path
|
|
301
|
+
if text.startswith(_WINDOWS_EXTENDED_PREFIX):
|
|
302
|
+
text = text[len(_WINDOWS_EXTENDED_PREFIX) :]
|
|
303
|
+
path = Path(text).resolve()
|
|
304
|
+
if path.is_relative_to(home) and path.is_file():
|
|
305
|
+
return path
|
|
306
|
+
session = _clean_id(session_id)
|
|
307
|
+
if not session or not session.replace("-", "").isalnum():
|
|
308
|
+
return None
|
|
309
|
+
# sessions/YYYY/MM/DD/rollout-<time>-<session id>.jsonl
|
|
310
|
+
for path in (home / "sessions").glob(f"*/*/*/rollout-*-{session}.jsonl"):
|
|
311
|
+
return path.resolve()
|
|
312
|
+
return None
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
def _codex_session_account(transcript_path: Any, session_id: Any = "") -> dict[str, str]:
|
|
316
|
+
"""Read Codex's account IDs from the first line of its session file.
|
|
317
|
+
|
|
318
|
+
Hook input names the file, but that format is not a stable interface and
|
|
319
|
+
can change between versions. Only a session file under Codex's own home is
|
|
320
|
+
opened, so a crafted path cannot point the hook at another file. Nothing is
|
|
321
|
+
read past the first line.
|
|
322
|
+
"""
|
|
323
|
+
try:
|
|
324
|
+
path = _codex_session_file(_codex_home(), transcript_path, session_id)
|
|
325
|
+
if path is None:
|
|
326
|
+
return {}
|
|
327
|
+
with path.open("rb") as handle:
|
|
328
|
+
line = handle.readline(_SESSION_META_MAX_BYTES + 1)
|
|
329
|
+
if len(line) > _SESSION_META_MAX_BYTES:
|
|
330
|
+
return {}
|
|
331
|
+
record = json.loads(line)
|
|
332
|
+
if not isinstance(record, dict) or record.get("type") != "session_meta":
|
|
333
|
+
return {}
|
|
334
|
+
payload = record.get("payload")
|
|
335
|
+
if not isinstance(payload, dict):
|
|
336
|
+
return {}
|
|
337
|
+
return account_from_ids(
|
|
338
|
+
payload.get("creator_account_id"), payload.get("creator_user_id"), "session_meta"
|
|
339
|
+
)
|
|
340
|
+
except (OSError, UnicodeError, ValueError, TypeError):
|
|
341
|
+
return {}
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
def account_for_hook(source_app: str, data: dict[str, Any]) -> dict[str, str]:
|
|
345
|
+
"""Extract an account claim for the agent that sent this hook payload."""
|
|
346
|
+
source = source_app.strip().lower()
|
|
347
|
+
if source == "cursor":
|
|
348
|
+
email = data.get("user_email")
|
|
349
|
+
if email is None:
|
|
350
|
+
email = data.get("userEmail")
|
|
351
|
+
return account_from_email(email, "hook_payload")
|
|
352
|
+
if source == "claude":
|
|
353
|
+
return _local_claude_account()
|
|
354
|
+
if source == "codex":
|
|
355
|
+
ids = _codex_session_account(data.get("transcript_path"), data.get("session_id"))
|
|
356
|
+
signed_in = _codex_auth_account()
|
|
357
|
+
return {**ids, **signed_in} if signed_in else ids
|
|
358
|
+
if source == "antigravity":
|
|
359
|
+
return _local_antigravity_account()
|
|
360
|
+
return {}
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
def account_for_otel(attrs: dict[str, Any]) -> dict[str, str]:
|
|
364
|
+
"""Extract Claude's documented OpenTelemetry account attributes."""
|
|
365
|
+
email = attrs.get("user.email")
|
|
366
|
+
org = attrs.get("organization.id")
|
|
367
|
+
return account_from_email(email, "otel", org) or account_from_organization(org, "otel")
|
|
@@ -246,6 +246,19 @@ def canonical_to_udm(canonical: dict[str, Any]) -> dict[str, Any]:
|
|
|
246
246
|
source = canonical.get("source") or {}
|
|
247
247
|
if source.get("app"):
|
|
248
248
|
labels.append({"key": "source_app", "value": str(source["app"])})
|
|
249
|
+
account = canonical.get("account") or {}
|
|
250
|
+
if account.get("domain"):
|
|
251
|
+
labels.append({"key": "agent_account_domain", "value": str(account["domain"])})
|
|
252
|
+
if account.get("source"):
|
|
253
|
+
labels.append({"key": "agent_account_source", "value": str(account["source"])})
|
|
254
|
+
if account.get("organization_id"):
|
|
255
|
+
labels.append({"key": "agent_account_organization_id", "value": str(account["organization_id"])})
|
|
256
|
+
if account.get("account_id"):
|
|
257
|
+
labels.append({"key": "agent_account_id", "value": str(account["account_id"])})
|
|
258
|
+
if account.get("user_id"):
|
|
259
|
+
labels.append({"key": "agent_account_user_id", "value": str(account["user_id"])})
|
|
260
|
+
if account.get("email"):
|
|
261
|
+
labels.append({"key": "agent_account_email", "value": str(account["email"])})
|
|
249
262
|
if labels:
|
|
250
263
|
udm["additional"] = {"labels": labels}
|
|
251
264
|
|