Independent Auditing of AI Agents. Run by human or the agent itself, to answer the most crucial question in the AI Agent Economy. Is the agent doing what is supposed to do? With iFixAi you can have this answer in less than 120 seconds.
Python agent-evaluationaiai-alignmentai-evaluationai-governanceai-safetyclidiagnostic-tooleu-ai-acthallucination-detectioniso-42001llm-evaluationllm-securitynist-ai-rmfowasp-llmprompt-injectionpythonresponsible-airisk-assessmentrisk-management
telemetry: record the surface that ran and whether it was pip-installed or a clone (#83)
n-papaioannouf0b423930373
diff --git a/SECURITY.md b/SECURITY.mdindex f571274..9e0711a 100644--- a/SECURITY.md+++ b/SECURITY.md@@ -54,7 +54,7 @@ Generic `Authorization: Bearer <token>` and `X-API-Key: <value>` headers are scr## Telemetry-The CLI sends pseudonymous run telemetry so we can count how many people use iFixAi and whether they return. It is consent-first: disclosed in plain language on first run, off automatically in CI, and every opt-out is honored *before* any identifier is created or any event is sent.+iFixAi sends pseudonymous run telemetry — from the CLI, the plugin, and scaffolded agent skills alike, since all three run the same engine — so we can count how many people use it and whether they return. It is consent-first: disclosed in plain language on first run, off automatically in CI, and every opt-out is honored *before* any identifier is created or any event is sent.**What is sent** — one `ifixai_started` event per run, plus `ifixai_completed` when a run produces a report:@@ -64,7 +64,8 @@ The CLI sends pseudonymous run telemetry so we can count how many people use iFi| event | `ifixai_started` / `ifixai_completed` | run count + completion rate || version | `3.0.2` | adoption per release || os | `Darwin` / `Linux` / `Windows` (from `platform.system()`) | platform mix |-| surface | `cli` / `plugin` | separate the two run interfaces |+| surface | `cli` / `plugin` / `skill` | separate the run interfaces |+| install_source | `pip` / `repo` | read downloads and runs as one funnel || timestamp | ISO-8601 UTC | retention across days |**Never sent:** file contents, findings, grades, prompts, file/repo paths, hostnames, usernames, environment values, or your IP address. The collector (PostHog, US region) is configured to discard the request IP at ingestion, and every event also carries `$ip: null` and `$geoip_disable: true`. Inspect the exact payload anytime with `ifixai run --print-telemetry`.@@ -77,7 +78,7 @@ The CLI sends pseudonymous run telemetry so we can count how many people use iFi- a file at `${XDG_CONFIG_HOME:-~/.config}/ifixai/telemetry-opt-out`- automatically in CI (`CI`, or a known vendor variable such as `GITHUB_ACTIONS`)-**Data protection (GDPR / UK GDPR).** The install id is a persistent identifier, so this telemetry is *pseudonymous personal data*, not anonymous. Lawful basis: legitimate interest (Art 6(1)(f)) in understanding adoption and retention; the processing is minimal (five fields, no model I/O), IP-stripped, opt-out-respecting, and never used for profiling or advertising. **Retention: events are kept indefinitely** — we do not auto-delete. **Erasure:** run `ifixai run --show-id` to read your install id, then email **[email protected]** to have its events deleted; deleting the local `install-id` file stops future linkage but does not remove rows already collected. Data controller: iMe (**[email protected]**).+**Data protection (GDPR / UK GDPR).** The install id is a persistent identifier, so this telemetry is *pseudonymous personal data*, not anonymous. Lawful basis: legitimate interest (Art 6(1)(f)) in understanding adoption and retention; the processing is minimal (seven fields, no model I/O, only classifications and never the paths they were derived from), IP-stripped, opt-out-respecting, and never used for profiling or advertising. **Retention: events are kept indefinitely** — we do not auto-delete. **Erasure:** run `ifixai run --show-id` to read your install id, then email **[email protected]** to have its events deleted; deleting the local `install-id` file stops future linkage but does not remove rows already collected. Data controller: iMe (**[email protected]**).## Coordinated disclosurediff --git a/ifixai/cli/run.py b/ifixai/cli/run.pyindex dfa4395..26ddcd7 100644--- a/ifixai/cli/run.py+++ b/ifixai/cli/run.py@@ -829,7 +829,7 @@ def run(if no_telemetry:telemetry.disable()telemetry.show_disclosure()- telemetry.emit_started("cli")+ telemetry.emit_started()resolved_concurrency = _resolve_concurrency(concurrency, no_parallel)_print_concurrency_banner(resolved_concurrency)concurrency_governor = ConcurrencyGovernor(resolved_concurrency)@@ -1670,7 +1670,7 @@ def run(click.echo(f" Run nonce: {manifest.run_nonce}")click.echo(f" Manifest: {manifest_path}")- telemetry.emit_completed("cli")+ telemetry.emit_completed()if result.overall_score is None:click.echo(diff --git a/ifixai/scaffold/playbook.md b/ifixai/scaffold/playbook.mdindex 98cf19d..7c2236a 100644--- a/ifixai/scaffold/playbook.md+++ b/ifixai/scaffold/playbook.md@@ -65,7 +65,7 @@ and never add a flag that would skip the estimate.(`aiohttp` ships with the base engine); `--grounding sut` observes the agent as-shipped:```bash-uvx ifixai run \+IFIXAI_SURFACE=skill uvx ifixai run \--provider http --endpoint <agent-url> \--fixture <name-or-path.yaml> \--grounding sut \@@ -86,7 +86,7 @@ rules injected via `--grounding fixture`. This tests the model's rule-following,deployed system:```bash-uvx --from "ifixai[<provider>]" ifixai run \+IFIXAI_SURFACE=skill uvx --from "ifixai[<provider>]" ifixai run \--provider <provider> \--fixture <name-or-path.yaml> \--grounding fixture \diff --git a/ifixai/telemetry.py b/ifixai/telemetry.pyindex 8dc9683..617b98e 100644--- a/ifixai/telemetry.py+++ b/ifixai/telemetry.py@@ -38,7 +38,10 @@ POSTHOG_ENDPOINT = "https://us.i.posthog.com/i/v0/e/"POSTHOG_PROJECT_KEY = "phc_sSAKNHJwLY748x2BtZvDPR5xdnMr7PndS2gmnb2LsD2H"# The only user-data property keys that may ever leave the machine.-_ALLOWED_PROPS = frozenset({"version", "os", "surface"})+_ALLOWED_PROPS = frozenset({"version", "os", "surface", "install_source"})++# plugin is proven, never declared+_DECLARABLE_SURFACES = frozenset({"cli", "skill"})_REQUEST_TIMEOUT = 1.0 # seconds, hard cap per send_FLUSH_BUDGET = 1.0 # seconds, total atexit join budget@@ -53,7 +56,8 @@ _DISCLOSURE_TEXT = ("iFixAi sends pseudonymous run telemetry: a random local install id (a ""persistent identifier, so it counts as personal data under GDPR), whether a ""run started and completed, the tool version, your OS name, whether you ran "- "the CLI or the plugin, and a UTC timestamp. It never sends your code, "+ "the CLI, the plugin, or an agent skill, whether iFixAi was pip-installed or "+ "run from a clone, and a UTC timestamp. It never sends your code, ""findings, grades, prompts, file paths, ""or IP address — run with --print-telemetry to see exactly what goes out. ""Opt out anytime with --no-telemetry, IFIXAI_TELEMETRY=0, or DO_NOT_TRACK=1 "@@ -195,32 +199,65 @@ def show_disclosure() -> None:# --------------------------------------------------------------------------- ## Event emission# --------------------------------------------------------------------------- #-def emit_started(surface: str) -> None:- """Enqueue one ``ifixai_started`` event (idempotent per process).-- ``surface`` is ``"cli"`` or ``"plugin"`` so the two run paths stay separable.- """+def emit_started() -> None:+ """Enqueue one ``ifixai_started`` event (idempotent per process)."""global _started_emittedif _started_emitted:return_started_emitted = True- _enqueue("ifixai_started", surface)+ _enqueue("ifixai_started")-def emit_completed(surface: str) -> None:+def emit_completed() -> None:"""Enqueue an ``ifixai_completed`` event for a finished run (idempotent per process)."""global _completed_emittedif _completed_emitted:return_completed_emitted = True- _enqueue("ifixai_completed", surface)+ _enqueue("ifixai_completed")+++def _detect_surface() -> str:+ """Which interface ran this: ``plugin``, ``skill``, or ``cli``.++ The plugin is concluded from the interpreter's own location, since its engine+ lives in a venv under ``CLAUDE_PLUGIN_DATA``; a skill has no such tell and+ declares itself, so its value is checked rather than trusted.+ """+ plugin_data = os.environ.get("CLAUDE_PLUGIN_DATA")+ if plugin_data:+ try:+ if Path(sys.prefix).resolve().is_relative_to(Path(plugin_data).resolve()):+ return "plugin"+ except (OSError, ValueError):+ pass+ declared = os.environ.get("IFIXAI_SURFACE", "").strip().lower()+ return declared if declared in _DECLARABLE_SURFACES else "cli"+++def _install_source() -> str:+ """``"pip"`` if installed from a package, else ``"repo"``.++ Lets PyPI downloads and actual runs be read as one funnel. Only the+ classification is sent, never the path it came from.+ """+ try:+ parts = Path(__file__).resolve().parts+ except OSError:+ return "unknown"+ return "pip" if ("site-packages" in parts or "dist-packages" in parts) else "repo"-def _build_payload(event: str, install: str, surface: str) -> bytes:+def _build_payload(event: str, install: str) -> bytes:# Build strictly FROM the allowlist so nothing outside it can ever be sent —# an `assert` would be stripped under `python -O`, silently killing the guard.# sorted() keeps the --print-telemetry output deterministic.- source = {"version": VERSION, "os": platform.system(), "surface": surface}+ source = {+ "version": VERSION,+ "os": platform.system(),+ "surface": _detect_surface(),+ "install_source": _install_source(),+ }props: dict[str, object] = {key: source[key] for key in sorted(_ALLOWED_PROPS)}props["$ip"] = None # PostHog: don't capture/derive geo from the request IPprops["$geoip_disable"] = True@@ -234,14 +271,14 @@ def _build_payload(event: str, install: str, surface: str) -> bytes:return json.dumps(envelope).encode("utf-8")-def _enqueue(event: str, surface: str) -> None:+def _enqueue(event: str) -> None:try:if not is_enabled():returninstall = install_id()if install is None:return- _get_sender().submit(_build_payload(event, install, surface))+ _get_sender().submit(_build_payload(event, install))except Exception: # noqa: BLE001 — telemetry must never break a runpass # telemetry must never break a run@@ -307,7 +344,7 @@ def _flush() -> None:def print_payload() -> None:"""``--print-telemetry``: print the exact ``started`` JSON without sending or creating an id."""install = _read_id() or "<install-id created on first real run>"- body = json.loads(_build_payload("ifixai_started", install, "cli"))+ body = json.loads(_build_payload("ifixai_started", install))print(json.dumps(body, indent=2))