Requests and tool activity.
OTel describes instrumented sessions, requests, timing, and usage. Its coverage follows the producer.
FIELD GUIDE / 03
Request blocking through native pre-tool hooks. Collect runtime telemetry and provider audit records for observation. Choose the integration that answers your question.
01 / DOWNLOAD & EXTRACT
Seven native adapters connect tool activity to local policy decisions. Eleven telemetry sources bring runtime and provider audit observations into the same workflow. Review tested coverage and setup requirements before choosing your setup.
Release notesSHA-256 checksumsBuild from source
Using Cowork? Download the Cowork plugin ZIP and follow the upload instructions.
Unsigned portable packages. Keep the executable beside its engine library. Intel Macs and other architectures: build from source.
Extract your package and review platform prerequisites, then run commands from its directory. Keep the executable beside its engine library. On Windows use .\agent-lens.exe in place of ./agent-lens. These commands do not install client settings.
./agent-lens telemetry sourcesOTel describes instrumented sessions, requests, timing, and usage. Its coverage follows the producer.
Provider feeds describe events within an organization. Administrative logs do not capture every local tool call.
Seven adapters can request denial at supported synchronous pre-tool hooks. OTLP and provider audit ingestion never run block rules.
NATIVE HOOKS / EXPERIMENTAL ADAPTERS
Native adapter IDs are claude, codex, hermes, gemini, cursor, copilot, and cowork. A client must load the hook, invoke it before dispatch, and honor its response. Post-tool and lifecycle matches remain observations.
./agent-lens --state /absolute/path/lens-state start \
--output /absolute/path/events.jsonl --rules /absolute/path/default.yaml
./agent-lens --state /absolute/path/lens-state config --agent cursor
./agent-lens --state /absolute/path/lens-state config --agent copilot
./agent-lens --state /absolute/path/lens-state config --agent cowork.cursor/hooks.json, complete workspace trust, and reload/restart as required. Only preToolUse blocks. Generated config sets failClosed: true and a ten-second timeout; normal pre-tool and observational subagent-start responses explicitly allow continuation. Cloud initial read-only turns run no hooks..github/hooks/*.json or user .copilot/hooks/*.json, complete trust, and restart the CLI. Only preToolUse blocks. Direct exec/args configuration is CLI-only; its 30-second timeout fails open upstream. It is not an IDE/cloud integration.PreToolUse blocks; its config requests onFailure: block. Cloud tasks need the Linux executable and engine inside the plugin. A path to your Mac or Windows executable will not reach that runtime.Review complete event registries, installation and failure contracts and the Cowork packaging example. Configuration output does not install settings, grant trust, or prove hook invocation. Keep executable, engine, state, rules and output reachable in the actual runtime.
Live checks passed with Cursor 3.27.22 and Copilot CLI 1.0.105 on Windows 11 ARM64, plus Claude Desktop 4.29.0 using Cowork's Linux x64 cloud runtime: allowed files, blocked .env files, and policy off/on controls. See the tested versions and event coverage.
config --agent cursor configures a native gate. telemetry config --source cursor-runtime configures observation. Cowork OTel, Copilot OTel, session streams and provider audit feeds follow that same boundary.
02 / ELEVEN DISTINCT SOURCES
Official contracts checked October 29, 2026. Entitlements and admin permissions apply before a provider can export anything. Each row identifies a specific surface, not complete visibility into a product.
| Source / ID | Coverage / access | Ingest |
|---|---|---|
Claude Codeclaude-code-otel | Local runtime · opt-in client configuration | OTLP import / HTTP |
Claude Coworkclaude-cowork-otel | Cowork runtime · Team / Enterprise admin | OTLP via reachable collector |
Codexcodex-otel | Local runtime · user or managed OTel config | OTLP import / HTTP |
Cursor runtimecursor-runtime | Server-side OTel · Enterprise admin | OTLP via public HTTPS collector |
Copilot OTelcopilot-otel | Supported client runtime · local / managed config | OTLP import / HTTP |
Cursor auditcursor-audit | Team account changes · Enterprise Admin API | JSON import / API poll |
Copilot auditcopilot-audit | Copilot audit category · audit-read permission | JSON import / API poll |
Copilot session streamcopilot-session | Request / response records · eligible enterprise preview | JSON import |
Anthropic Complianceanthropic-compliance | Activity Feed · enabled API and scoped key | JSON import / API poll |
OpenAI API Platformopenai-audit | Organization administration · Admin API key | JSON import / API poll |
Gemini in Workspacegoogle-gemini | Workspace feature use · authorized Reports API | JSON import / API poll |
Local session folders are a fourth kind of evidence. A documented storage path does not establish a stable export schema. Lens does not crawl Copilot history or assume an IDE transcript format.
Cowork has its own monitoring configuration; it does not configure Claude Code or the Code tab. OpenAI API Platform audit logs are separate from Codex OTel. Workspace Gemini activity uses gemini_in_workspace_apps; it is separate from Gemini CLI hooks.
03 / LOCAL OBSERVATION JSONL
./agent-lens telemetry listen \
--source claude-code-otel --bind 127.0.0.1:4318 \
--output ./claude-code-telemetry.jsonlThe loopback listener accepts OTLP HTTP JSON and protobuf at /v1/logs, /v1/metrics, and /v1/traces. Providers may emit fewer signals. It has no gRPC server, TLS termination, or collector authentication. Use separate ports and files per source; the source label does not authenticate a sender.
Send HTTP/1.1 POST requests with Content-Length: up to 8 MiB per body, 16 KiB of headers, and a five-second read deadline. Chunked transfer and gzip are unsupported. Configure collector forwarding with compression disabled and a content length. Success follows a locked, synced append; normalized batches are limited to 10,000 events and 32 MiB.
./agent-lens telemetry import \
--source codex-otel --signal logs --format json \
--input ./otlp-logs.json --output ./codex-telemetry.jsonl
./agent-lens telemetry import \
--source copilot-otel --signal traces --format protobuf \
--input ./otlp-traces.pb --output ./copilot-telemetry.jsonlProvider exports use their documented JSON envelopes or JSONL records. Binary input is an OTLP export message, without a gRPC frame. CSV and arbitrary console output are not accepted contracts.
./agent-lens telemetry poll --source openai-audit \
--token-env OPENAI_ADMIN_KEY --output ./openai-audit.jsonl \
--checkpoint ./openai-audit.checkpoint.json --max-pages 10Provision the token through your approved secret manager first; --token-env names the variable, not the secret. A poll retrieves a bounded set of pages. It is not a background service or an OAuth login flow. Consult the source guide for account scope, time windows, pagination, and supported polling flags.
04 / EXPLICIT CONFIGURATION
./agent-lens telemetry config --source claude-code-otelReview the configuration templates and merge only the relevant settings manually. Managed policy can override local values. Complete normal client consent and trust steps; Lens does not edit global settings or bypass policy.
Cowork exports from its VM or cloud runtime. Cursor exports from its servers and requires public HTTPS with authentication. Their loopback address is not your host. Use a reachable, secured collector and forward to Lens on the collector host.
The Collector Contrib example provides TLS/auth ingress and an optional gRPC bridge. Supply real certificates and secrets outside source control, preserve source separation, and validate it against your installed Collector release. It is an example, not a tested production deployment.
05 / METADATA FIRST
Lens keeps an allowlist of metadata and drops raw log bodies, prompts, tool arguments/results, unknown fields, and recognized credential patterns. Output uses agent-lens.telemetry.v1 with enforcement: observe_only. A provider approval or denial is that provider's observation, not a Lens block.
otlpContentCapture to [].Configure output access, retention, rotation, and downstream identity yourself. AI Lens is not a durable, tamper-evident audit service and does not prove complete agent visibility.
06 / TRACEABLE RESEARCH
The full source guide preserves official URLs, retrieval dates, schemas, permissions, latency and content caveats for all eleven sources. It separates published contracts from local implementation tests.
Local fixture and receiver tests do not validate enterprise entitlements, managed-policy rollout, live-client delivery, cloud networking, or production reliability. No enterprise live test is claimed for these integrations.