Skip to content

fix: default gen_ai payload capture to off - #20

Merged
shreyas-n-harness merged 3 commits into
mainfrom
fix/payload-capture-default-off
Jul 28, 2026
Merged

fix: default gen_ai payload capture to off#20
shreyas-n-harness merged 3 commits into
mainfrom
fix/payload-capture-default-off

Conversation

@shreyas-n-harness

@shreyas-n-harness shreyas-n-harness commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Flip gen_ai.payload_capture_enabled default from true to false in default.py — prompt/response content is now captured only on explicit opt-in (HARNESS_/HA_/AT_/TA_GEN_AI_PAYLOAD_CAPTURE_ENABLED=true or YAML config). Unset or empty env var resolves to capture-off, matching the privacy-control intent in genai_env.py.
  • Accept HA_ alias for instrumentation opt-in flags: HARNESS_ENABLE_API / HARNESS_ENABLE_AI_* now resolve under both HARNESS_ and HA_ (HARNESS_ wins when both set). AT_/TA_ remain unsupported for these flags.
  • Honor explicit false for ENABLE_CONSOLE_SPAN_EXPORTER: was a presence check (any value, including false, enabled the exporter); now strict boolean — only true enables it, resolved with HARNESS_ > HA_ > AT_ > TA_ precedence via new is_env_flag_enabled. Removes the unused is_env_var_present helper.
  • Update tests and docs (sdk-quickstart.md, AGENTS.md).

Test plan

  • Full suite: 260 passed (mysql/postgresql integration excluded — require live DB, pre-existing failures on main)
  • New tests: HA_ alias enables opt-in flags, HARNESS_ wins over HA_, AT_/TA_ ignored; console exporter boolean resolution incl. explicit false, empty, legacy aliases, precedence
  • QA: unset/empty HA_GEN_AI_PAYLOAD_CAPTURE_ENABLED → prompts not captured; true → captured; HARNESS_ENABLE_CONSOLE_SPAN_EXPORTER=false → no console spans; HA_ENABLE_AI_OPENAI=true → OpenAI instrumented

Flip gen_ai.payload_capture_enabled default from true to false so prompt/
response content is only captured on explicit opt-in. Unset or empty
HARNESS_GEN_AI_PAYLOAD_CAPTURE_ENABLED now resolves to capture-off, matching
the privacy-control intent (disable wins unless explicitly enabled).

Update default-config test and docs to reflect the new default.

Co-authored-by: Cursor <cursoragent@cursor.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

shreyas-n-harness and others added 2 commits July 28, 2026 15:54
HARNESS_ENABLE_API and HARNESS_ENABLE_AI_* now resolve under both HARNESS_
and HA_ prefixes (HARNESS_ wins when both are set), matching the HA_/HARNESS_
parity of the other SDK settings. AT_/TA_ aliases remain unsupported — the
flags never existed under those prefixes.

Co-authored-by: Cursor <cursoragent@cursor.com>
The console span exporter was gated on env var presence, so
HARNESS_ENABLE_CONSOLE_SPAN_EXPORTER=false (or any value) still enabled it.
Switch to strict boolean resolution via the new is_env_flag_enabled helper:
only the case-insensitive value 'true' enables the exporter, resolved with
the usual HARNESS_ > HA_ > AT_ > TA_ precedence. Remove the now-unused
is_env_var_present presence-check helper.

Co-authored-by: Cursor <cursoragent@cursor.com>
@shreyas-n-harness
shreyas-n-harness merged commit 8be0996 into main Jul 28, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants