Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/frameworks/agno/tests/test_f2_default_zero.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test_f2_agno_default_env_and_explicit_positive(monkeypatch):


def test_f2_agno_supplied_config_without_cap_resolves_zero(monkeypatch):
# Lead slice (RL 2193): F2-PY-CAP0-COMPLETENESS-001. A config passed only to
# Cap-0 completeness: a config passed only to
# set another option carries OI's default cap and must not bypass cap 0.
from openinference.instrumentation import TraceConfig as OITraceConfig
from traceai_agno._wrappers._privacy import privacy_configs, _PrivacyConfig
Expand Down
2 changes: 1 addition & 1 deletion python/frameworks/agno/tests/test_privacy_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_fi_hides_cannot_be_undone_by_openinference(monkeypatch, name):
assert getattr(supplied, name) is False
for field in fields(supplied):
if field.name == "base64_image_max_length":
# F2 (RL 2310bu): a supplied OI config without an explicit cap resolves to the FI default 0.
# A supplied OI config without an explicit cap resolves to the FI default 0.
assert getattr(effective, field.name) == 0
elif field.name != name:
assert getattr(effective, field.name) == getattr(supplied, field.name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_core_not_instrumentor_applies_image_mask(monkeypatch):
assert type(attrs["input.value"]) is module.ChatInput
# Reapply a different policy to the same ORIGINAL typed data. This cannot
# work with a package-sanitized string or a boolean assertion of trust.
# F2 (RL 2310bu): retain the original assertions at the former default cap.
# Retain the original assertions at the former default cap.
visible = TraceConfig(base64_image_max_length=32_000).mask("input.value", attrs["input.value"])
assert IMAGE in visible and PROMPT in visible
hidden = TraceConfig(hide_input_text=True, base64_image_max_length=32_000).mask(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

def _resolved_default_image_cap():
"""The installed core's default cap. The core-floor job installs the oldest supported
fi-instrumentation-otel, whose default is 32000; F2 (RL 2310bu) cores default to 0."""
fi-instrumentation-otel, whose default is 32000; newer cores default to 0."""
saved = os.environ.pop("FI_BASE64_IMAGE_MAX_LENGTH", None)
try:
return TraceConfig().base64_image_max_length
Expand Down Expand Up @@ -89,7 +89,7 @@ def test_image_privacy_every_exported_copy(monkeypatch, asynchronous, env, polic
elif policy in ("limit", "boundary"):
config["base64_image_max_length"] = len(url) - (policy == "limit")
elif policy == "visible":
# F2 (RL 2310bu): the former default is now an explicit opt-in twin.
# The former default is now an explicit opt-in twin.
config["base64_image_max_length"] = 32_000
if env:
for key, value in config.items():
Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_chat_input_leaf_privacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_case_insensitive_scheme_preserves_original_reference(url, hide, cap):
result = json.loads(TraceConfig(**options).mask("input.value", ChatInput(payload)))
text, image = result["messages"][0]["content"]
assert text["text"] == (REDACTED_VALUE if hide == "hide_input_text" else "visible")
# F2 (RL 2310bu): at the default cap 0 the hidden slot of an image part is an image
# At the default cap 0 the hidden slot of an image part is an image
# payload position, so its marker is replaced whole; a positive cap keeps the marker.
hidden_image = REDACTED_VALUE if cap else "[image-redacted]"
assert image["image_url"] == (hidden_image if hide == "hide_input_images" else {"url": url})
Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_chat_input_privacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def attributes(records):

@pytest.mark.parametrize("key", ["input.value", "raw.input"])
@pytest.mark.parametrize("options,hidden", [
# F2 (RL 2310bu): the default image cap is 0, so the data: image is hidden unless a
# The default image cap is 0, so the data: image is hidden unless a
# positive cap is set; each default row keeps a twin at the previous default cap.
({}, [IMAGE]),
({"base64_image_max_length": 32_000}, []),
Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_granular_payload_privacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_text_privacy_is_directional(direction, opposite):


def test_text_flag_keeps_explicitly_typed_images():
# F2 (RL 2310bu): the text flag never hides typed images; pinned at the previous
# The text flag never hides typed images; pinned at the previous
# default cap. At the default cap 0 a typed image value is an over-cap payload.
config = TraceConfig(hide_input_text=True, base64_image_max_length=32_000)
assert config.mask("gen_ai.input.images.0", "image-reference") == "image-reference"
Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_image_cap_f2_default_zero.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ def test_f2_fixed_marker_remains_protected():
cap_base64_images("ordinary", 0, "[image-redacted]")


# Ruling r2 continuation (LANE-CALL-NIKM4-5A-F2-CAP0-OVERREDACTION-r2): the cap-0
# The cap-0
# trigger is data:, then image/, then a comma, within one Q1 scope view.


Expand Down
4 changes: 2 additions & 2 deletions python/tests/test_image_cap_failclosed_r4.py
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@ def test_r4c8_protected_false_flag():
('r4c8/false_flag/7/array', '["data:image/png;name=\\"x;ba%26#115;e64;y\\",QUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJD","unchanged"]', 0, '["data:image/png;name=\\"x;ba%26#115;e64;y\\",QUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJD","unchanged"]', 0),
)
for case_id, value, maximum, expected, count in cases:
# F2 (RL 2310bu, CAP0-OVERREDACTION-r2): cap 0 now redacts every data: image mention; the precise
# Cap 0 now redacts every data: image mention; the precise
# false-flag protection is asserted at the strictest positive cap instead.
maximum = max(maximum, 1)
assert _cap_base64_images_counted(value, maximum, A) == (expected, count), case_id
Expand Down Expand Up @@ -1547,7 +1547,7 @@ def test_r4c6_lead_ts_lens_witnesses_python_outputs():
assert cap_base64_images(first, 64, A) == first


# Lead slice (RL 2193; F2-PY-PTC-AND-COMPAT P2): the r4c8 inputs whose precise assertions moved to cap 1
# The r4c8 inputs whose precise assertions moved to cap 1
# keep their cap-0 (F2 default) expectations here: whole Q1 scope [image-redacted], count 1, idempotent.
F2_CAP0_R4C8 = (
('r4c8/false_flag/0/raw', 'data:image/png;base64=ordinary,QUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJDQUJD', '[image-redacted]'),
Expand Down
2 changes: 1 addition & 1 deletion python/tests/test_image_cap_failclosed_witnesses.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Fail-closed r4 witness controls (fi-security 628059fc; RL 2310ah). Lead-authored from the fail-closed r3 lens witnesses; RED on the r3 base."""
"""Fail-closed r4 witness controls, derived from the fail-closed r3 witnesses; they fail on the r3 code."""
from fi_instrumentation.instrumentation._image_cap import cap_base64_images

BS = chr(92)
Expand Down
12 changes: 6 additions & 6 deletions spec/auto-instrumentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ Every SDK runs every case in `privacy-fixtures.json`. Recognition gaps are fixed
a catalog rule applied inconsistently at different sites is an SDK bug.

The initial vocabulary is the union of the six SDKs' privacy implementations and missed names
reported in the round-4/5 verdicts. `credentials.sources`, `seed_names`, and
`missed_name_sources` retain the provenance. All seed and missed names have generated cases.
reported in the round-4/5 verdicts. `credentials.sources` and `seed_names` retain the provenance;
`missed_name_sources` groups the missed names by review. All seed and missed names have generated cases.

1. **Credential patterns and exclusions.** ASCII-lowercase names and fold `-`, `_`, and `.`.
Match the catalog's `contains` patterns (`token`, `secret`, `key`, `auth`, `password`,
Expand Down Expand Up @@ -362,7 +362,7 @@ reported in the round-4/5 verdicts. `credentials.sources`, `seed_names`, and
`session_token`, `token_secret`, `api_token_latency_key` and `auth_token` remain private.
Credential ancestors/descendants still win; timing names are not blanket subtree exemptions.

`credentials.contextual_exclusions` remains empty. RL 2299t's reviewed exception
`credentials.contextual_exclusions` remains empty. The reviewed name-only exception
is instead the closed, versioned `logprob_tokens` list and an explicit parsed
provider-response entry point, not a name/path heuristic available to every
JSON payload. In that context, **logprob tokens are checked against registered secrets and credential shapes, not key-name rules**.
Expand Down Expand Up @@ -574,7 +574,7 @@ python3 -I spec/auto-instrumentation/sync.py
```

On shared hosts, prefix **every** generator/test/runtime invocation with the host-safety
wrapper `/Volumes/nikm4/futureagi/tmp/traceai-auto-review/heavy.sh` via `bash`.
wrapper that the host provides, if it has one.

### Review follow-up (2026-10-30)

Expand Down Expand Up @@ -1026,7 +1026,7 @@ implementation, resource preservation or attribute-container admission.

## Node manual and zero-code batching compatibility

RL2299h preserves the manual public API: explicit **or omitted** `batch: false`
The manual public API is preserved: explicit **or omitted** `batch: false`
on fi-core `register()` / `FITracerProvider` selects SimpleSpanProcessor. Manual
`batch: true` selects bounded BatchSpanProcessor. The zero-code auto agent
explicitly constructs BatchSpanProcessor for its owned export route and requests
Expand All @@ -1046,7 +1046,7 @@ Neither queuing nor successful local handoff proves remote collector acceptance.

The shared credential catalog still masks access-key identifiers and untrusted
token-named fields. Only the explicitly bound provider-root logprob paths above
use RL 2299t's name-only exception and required reconstruction rule; numeric token
use the reviewed name-only exception and required reconstruction rule; numeric token
metrics remain available. Credential values use `<redacted>`; embedding-vector hiding is
a fi-core content policy and uses its dev `__REDACTED__` marker, not a new catalog
credential replacement. Generated privacy fixture bundles must be regenerated
Expand Down
38 changes: 14 additions & 24 deletions spec/auto-instrumentation/generate_privacy_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,31 +268,21 @@ def privacy_catalog():
'java/traceai-javaagent/src/main/java/ai/traceai/auto/WirePrivacy.java',
'csharp/src/TraceAI.AutoInstrumentation/Wire/WirePrivacy.cs',
'ruby/lib/traceai/auto/privacy.rb'],
'missed_name_sources': [{'review': 'round4-final-node-r4.txt',
'names': ['x-goog-api-key',
'missed_name_sources': [{'names': ['x-goog-api-key',
'anthropic-api-key',
'ocp-apim-subscription-key']},
{'review': 'round4-final-csharp-r4.txt',
'names': ['authorization_token', 'client_secret', 'password']},
{'review': 'round4-final-node-genkit.txt',
'names': ['apiKey', 'X-Amz-Signature']},
{'review': 'round4-final-node-mastra.txt', 'names': ['api_key']},
{'review': 'round4-final-py-agentscope.txt', 'names': ['Authorization']},
{'review': 'round4-final-python-r4.txt', 'names': ['Authorization']},
{'review': 'round4-final-launcher.txt',
'names': ['api_key', 'secret_key', 'X-Amz-Signature']},
{'review': 'round5-final-go-s5.txt',
'names': ['client_secret', 'Proxy-Authorization']},
{'review': 'round5-final-java-s5.txt',
'names': ['X-Auth-Token', 'passwd', 'token']},
{'review': 'round5-final-genkit-s5.txt',
'names': ['x-vault-token', 'database_password']},
{'review': 'round5-final-python-s5.txt',
'names': ['X-Session-Id', 'auth_token', 'x-vault-token']},
{'review': 'round5-final-csharp-s5.txt',
'names': ['key', 'passwd', 'Set-Cookie', 'private-token', 'x-vault-token']},
{'review': 'round5-final-ruby-s5.txt',
'names': ['x-access-token',
{'names': ['authorization_token', 'client_secret', 'password']},
{'names': ['apiKey', 'X-Amz-Signature']},
{'names': ['api_key']},
{'names': ['Authorization']},
{'names': ['Authorization']},
{'names': ['api_key', 'secret_key', 'X-Amz-Signature']},
{'names': ['client_secret', 'Proxy-Authorization']},
{'names': ['X-Auth-Token', 'passwd', 'token']},
{'names': ['x-vault-token', 'database_password']},
{'names': ['X-Session-Id', 'auth_token', 'x-vault-token']},
{'names': ['key', 'passwd', 'Set-Cookie', 'private-token', 'x-vault-token']},
{'names': ['x-access-token',
'private-token',
'x-vault-token',
'client_secret',
Expand Down Expand Up @@ -951,7 +941,7 @@ def query_object_sites(prefix, pairs):
add(f"contextual-descendant-{item['id']}-{i}-{site}", site, secret, redacted, path + ".api_key")
logprobs = {"choices": [{"logprobs": {"content": [{"token": "Hello", "logprob": -0.2,
"top_logprobs": [{"token": "world", "logprob": -0.3}]}]}}]}
# RL2298g: keep the shared path no weaker than the manual Mastra oracle.
# Keep the shared path no weaker than the manual Mastra oracle.
# Retain logprob numbers, but token-named payloads no longer get an exemption.
masked_logprobs = {"choices": [{"logprobs": {"content": [{"token": redacted, "logprob": -0.2,
"top_logprobs": [{"token": redacted, "logprob": -0.3}]}]}}]}
Expand Down
17 changes: 2 additions & 15 deletions spec/auto-instrumentation/privacy.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"scalar_metrics": {
"version": 6,
"canonical_decimal": {
"ruling": "LANE-CALL-NIKM4-5A-I1-DIGIT-STRING-COUNTS-r2 with I1-R10B A-DIGIT-CONFINED",
"ruling": "A declared canonical-decimal counter keeps a full decimal count string with a safe-integer value, unless the string has base64 shape.",
"regex": "^(0|[1-9][0-9]{0,15})$",
"max_chars": 16,
"base64_min_chars": 4,
"keys": ["gen_ai.audio.bytes"],
"scope": "Only declared canonical-decimal counters consult this rule. gen_ai.audio.bytes keeps full canonical decimal strings with a safe-integer numeric value unless they have base64 shape at or above base64_min_chars. elevenlabs.audio.bytes never grants a string role. The four-character shape threshold is not a special case for one count. Preserve accepted string types; no signs, leading zeros, fractions, exponents, whitespace or final newline. Other G4 core/detail keys retain their original scalar roles, including arbitrary strings and literal undefined. This rule does not change Q8b NON_CONTENT types."
},
"ruling": "TRACEAI-I1-G3-G4-POLICY-SCOPE-RULING-r1-FISEC G4",
"ruling": "Only exact declared usage and metric keys get a scalar metric role, and media, credential and secret signals always take precedence over it.",
"scope": "Closed exact complete keys in the declared usage/metrics containers only. Case, punctuation, prefixes, suffixes and array indices are not aliases. A nested object path must equal the complete key. gen_ai.audio and elevenlabs.audio are metric containers only for their listed bytes counters, not for arbitrary audio members. Their nonnegative_safe_integer value_type grants a role to finite nonnegative safe-integer numbers; only gen_ai.audio.bytes additionally accepts strings under canonical_decimal. gen_ai.usage.cache_read_tokens.audio also accepts only nonnegative safe-integer numbers, never strings. All other inputs on these typed counters retain the role-free media policy. Other declared metrics keep their original number/boolean/string roles without decimal validation.",
"precedence": "Scalar role only removes structural media classification caused by the metric spelling. Explicit media/type hints on any ancestor, inherited media/audio, established media payload ancestry, credential ancestry and known numeric/string secrets take precedence. On the two typed byte counters only, base64-shaped strings at or above canonical_decimal.base64_min_chars cannot obtain a role, even when numerically safe. Magic bytes, data URIs and other independent value checks still apply. A counter leaf under established media payload ancestry cannot use the usage metadata boundary to escape omission. Private payload-role ancestry survives parsed, stringified and diagnostic JSON handoffs; resetting a JSON root never grants a metric role. Metric-looking descendants reached through this retained payload origin remain payload, including numeric/bool scalars and numeric/bool arrays; ordinary metadata text boundaries are unchanged.",
"arrays": "Arrays never receive the scalar metric role. Nonempty numeric/bool media payload arrays are omitted; existing string/object array walking and empty-array behavior remain unchanged.",
Expand Down Expand Up @@ -391,86 +391,74 @@
],
"missed_name_sources": [
{
"review": "round4-final-node-r4.txt",
"names": [
"x-goog-api-key",
"anthropic-api-key",
"ocp-apim-subscription-key"
]
},
{
"review": "round4-final-csharp-r4.txt",
"names": [
"authorization_token",
"client_secret",
"password"
]
},
{
"review": "round4-final-node-genkit.txt",
"names": [
"apiKey",
"X-Amz-Signature"
]
},
{
"review": "round4-final-node-mastra.txt",
"names": [
"api_key"
]
},
{
"review": "round4-final-py-agentscope.txt",
"names": [
"Authorization"
]
},
{
"review": "round4-final-python-r4.txt",
"names": [
"Authorization"
]
},
{
"review": "round4-final-launcher.txt",
"names": [
"api_key",
"secret_key",
"X-Amz-Signature"
]
},
{
"review": "round5-final-go-s5.txt",
"names": [
"client_secret",
"Proxy-Authorization"
]
},
{
"review": "round5-final-java-s5.txt",
"names": [
"X-Auth-Token",
"passwd",
"token"
]
},
{
"review": "round5-final-genkit-s5.txt",
"names": [
"x-vault-token",
"database_password"
]
},
{
"review": "round5-final-python-s5.txt",
"names": [
"X-Session-Id",
"auth_token",
"x-vault-token"
]
},
{
"review": "round5-final-csharp-s5.txt",
"names": [
"key",
"passwd",
Expand All @@ -480,7 +468,6 @@
]
},
{
"review": "round5-final-ruby-s5.txt",
"names": [
"x-access-token",
"private-token",
Expand Down
2 changes: 1 addition & 1 deletion typescript/packages/fi-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ API while making zero-code ownership explicit.
### Media policy and image cap for this release

For this release, the ratified
`LANE-CALL-NIKM4-5A-TS-IMAGE-EXPORT-I1-DOMINATES-r1` decision makes I1 media
media policy makes I1 media
omission dominant at every cap in the FI retained/export view. Recognized
base64/media and data URLs are omitted, including images at or below a positive
cap; recognized base64 image payloads in payload fields or `data:` URLs use
Expand Down
Loading
Loading