Repository navigation
logwarden v0.10.2
logwarden v0.10.2
Status: Released 2026-11-23 · tag v0.10.2
Outcome: fixes for bugs found by a user. Following the standard could still fail the check, or lose information:
- Lists. A field declared
type: string[]inlogwarden-fields.yaml, logged as
["a","b"], failed withtype_mismatch("Attribute 'tags' has type 'string'. Type should
be 'string[]'."), so no list field could pass. logwarden gave Weaver every list as JSON text,
typedstring. For the same reasonlogwarden init --fromproposedtype: stringfor list
fields. gen_ai.*fields. The standard (§2) says to loggen_ai.provider.name,
gen_ai.request.modelandgen_ai.usage.input_tokens, andadr_banned_synonymsuggests
gen_ai.request.modelformodel. But each of them failed withdeprecated("Moved to the
OpenTelemetry GenAI semantic conventions repository"). In semantic conventions 1.45.0, which
logwarden bundles, every GenAI field is deprecated because it moved to a separate
repository, not because it was renamed, so the finding names nothing to use instead. A
service that calls an LLM could not pass thestandardprofile.- Source lines missing when logging is set up in
conftest.py. The pytest plugin turns on
code.file.pathandcode.line.number(for--sarif, GitLab Code Quality and "Fix
first" by file and line) by settingLOGWARDEN_CALLSITE=1inpytest_configure. pytest
importsconftest.pybefore that, so aconfigure()at the top ofconftest.pyran
without it: 0 of 106 captured lines had the fields in one service, while another, which set
up logging later during test collection, had them on 569 of 569. init --fromcontradicted the standard on naming. Its comment on a field without dots
said "A bare name: better namespaced (e.g. myservice.auth_source) in the code", while
§2 says a service's own fields are snake_case without dots.- Timestamp ids reported as card numbers.
adr_sensitive_datatook any 13 to 19 digits
starting with 2 to 6, with a space or dash anywhere, that pass the Luhn checksum, so about one
id in ten like20260911-120000orui_draft/20261122-155637-…was "a card number". - A baseline entry hid every secret in its field. A baseline entry matches by rule, field,
logger and event. The workaround for 5 (baseliningquery_paramsonRequest completed)
also hid a real JWT planted in that field on a later line. - Python 3.10 and 3.11 couldn't unpack the GenAI archive (found by CI on this release). The
archive has two symlinks (CLAUDE.md -> AGENTS.md), and without Python 3.12's extraction
filters logwarden rejected any archive with a link: "unsafe path in archive".
Fixes
Lists
- Lists are checked as arrays. A list whose items are all one type goes to Weaver as
string[],int[],double[]orboolean[], with its items. Ints and doubles together are
double[]. A list with mixed items, nulls, lists or objects is still checked as JSON text
(string), as before. This also applies to semconv fields typed as arrays, such as
process.command_args. - An empty list takes the declared type.
[]has no items to go by, so when the field is
declared as an array type, it is checked as that type. Otherwise it stays JSON text. This
costs one extra Weaver call (resolving the registry), only when the input has an empty list. - Secrets inside lists are still found. The sensitive-data rules scanned a list's JSON text.
They now scan each item (strings and whole numbers), one item at a time, so two numbers never
join into a card number. init --fromproposes array types, e.g.type: string[]for a list of strings. Empty
lists don't count when picking the type; a field that was only ever[]isstring[].
GenAI fields
- logwarden bundles the OpenTelemetry GenAI semantic
conventions v0.1.0 (their
first release, built on semantic conventions 1.45.0) next to semantic conventions 1.45.0.
Thegen_ai.*,openai.*,mcp.*,a2a.*andaws.bedrock.*fields they define are
current fields again, with GenAI's types (for examplegen_ai.request.top_kis nowint). - Each field has one definition. Semantic conventions 1.45.0 keeps the moved fields as
deprecated in itsgen-ai,mcpandopenaidirectories. With both registries loaded, Weaver
reports each such field as declared twice and uses one definition or the other depending on
the group order, sogen_ai.tool.nameand themcp.*fields stayed deprecated. logwarden
leaves out the semconv directories that GenAI replaces (those with the same name). - Old GenAI names still say what to use. Names that GenAI v0.1.0 no longer has would
otherwise be reported as unknown (missing_attribute). logwarden's registry declares them as
deprecated, with the new name:gen_ai.system→gen_ai.provider.name,
gen_ai.usage.prompt_tokens→gen_ai.usage.input_tokens,gen_ai.usage.completion_tokens→
gen_ai.usage.output_tokens,gen_ai.usage.cache_creation.input_tokens→
gen_ai.usage.cache_write.input_tokens,gen_ai.workflow.name→gen_ai.agent.name,
gen_ai.openai.request.seed→gen_ai.request.seed,gen_ai.openai.request.response_format→
gen_ai.output.type, the threegen_ai.openai.*service tier and fingerprint fields →
openai.*.gen_ai.token.typeis deprecated without a new name (GenAI replaced it with
separate histograms). - Offline: the GenAI archive is downloaded once with a pinned SHA-256 and cached, like the
semantic conventions;logwarden setupand the Docker image include it. To use your own copy,
setLOGWARDEN_SEMCONV_GENAIto itsmodeldirectory (new environment variable). - The pin update (
update-pins.yml) also looks for new GenAI releases. docs/standard.md: the GenAI note now says logwarden bundles the GenAI conventions, and
thatdeprecatedfindings name the new field when there is one.
Secret findings
- Card numbers need an issuer's prefix and length (Visa 13/16/19 digits, Mastercard 51-55
and 2221-2720, American Express 34/37, Diners Club, Discover, JCB, UnionPay, Maestro) and
card grouping: no separators, groups of 4 (4111 1111 1111 1111, with a last group of up to
3), or 4-6-5 / 4-6-4 (American Express, Diners Club). Then the Luhn checksum, as before.
20260911-120000(14 digits starting 2026, 8-6 grouping) is neither. - Baseline entries for
adr_sensitive_datarecord what was found: a newkindkey
(key,nested,jwt,bearer_token,api_key,private_key,url_credentials,
email,card_number). An entry hides only that kind, so a known card number in a field no
longer hides a JWT there. Entries of other rules are unchanged.--comparewith a snapshot
matches the same way, and the SARIF and Code Quality fingerprints of secret findings include
the kind. - Old secret entries hide nothing. A baseline written before v0.10.2 has no
kindon its
adr_sensitive_dataentries, so it can't say which secret it accepted. Those entries no
longer match. The result counts them in a new--jsonkey,baseline_outdated, and the text
and Markdown output say: "N adr_sensitive_data entries are from before v0.10.2 and no longer
hide anything; check those findings, then run 'logwarden baseline'". They are not counted in
baseline_fixed.
Other fixes
- The pytest plugin sets
LOGWARDEN_CALLSITE=1when it is imported (only while
LOGWARDEN_CAPTUREis set, and not over a value you set). pytest imports plugins installed
with the package before anyconftest.py, so logging set up there gets the source fields. - Archives unpack on Python 3.10 and 3.11: links in a downloaded archive are skipped
instead of failing the download (nothing logwarden reads is a link). Absolute paths and..
are still refused. Python 3.12 and later already used the safe extraction filter. init --fromfollows the standard: the hint is now on dotted names ("Dotted: the
standard (§2) names a service's own fields snake_case without dots; dots are for semconv
names"), and fields without dots get none. The Claude Code skill says the same.
Changes you might notice
-
A list field that was declared
stringto get past the bug now fails withtype_mismatch.
Change it to the array type. -
GenAI fields:
deprecatedfindings on current GenAI fields go away. A field that GenAI
changed can now fail where it passed:gen_ai.request.top_klogged as a decimal
(type_mismatch, nowint), and fields GenAI removed or renamed (deprecatedwith the new
name). Fields from other semconv areas are unchanged. -
A list field in the
essentialprofile: no change (unknown and mistyped fields are outside
essential). -
Fewer
adr_sensitive_datafindings for numbers that only looked like cards: ids and
timestamps with dashes in non-card places, and digit strings with no card issuer's prefix
and length. On the five sample sets (below) no finding changed. -
GitHub code scanning and GitLab Code Quality show existing secret findings once as fixed and
new, because their fingerprint now includes the kind.
Breaking changes
- A baseline with
adr_sensitive_dataentries fails again until it is regenerated: check
the findings it now reports (baseline_outdatedsays how many entries are affected), fix
the real ones, then runlogwarden baseline. This breaks the promise that a baseline from
an older version keeps working, under the security exception now inSTABILITY.md: an old
entry can't tell an accepted value from a leaked secret.
Verification
| # | Claim | How it will be checked | Result |
|---|---|---|---|
| 1 | Declared list fields pass | tags: string[], counts: int[], ratios: double[], flags: boolean[] in a fields file; lines with lists of each type, with empty lists, and the semconv process.command_args: check --profile standard reports 0 violations. The user's one-line case gives 0 violations |
✅ tests/test_list_fields.py::test_declared_list_fields_pass: lists of each type, empty lists of each type and process.command_args: 0 violations. The user's one-line case (tags: string[], ["a","b"]): 1 records, 0 violations, exit 0 (was type_mismatch). Unit tests: [1, 2.5] → double[], [true, 1], ["a", null], [["a"]], [{...}] and an undeclared [] stay JSON text |
| 2 | Wrong lists still fail | [1, 2.5] for int[], a string for string[], a mixed list for string[]: one type_mismatch each |
✅ test_wrong_list_types_fail: exactly one type_mismatch on each of the three lines |
| 3 | Secrets inside lists | An email, a card number (in a string and as a number), a Bearer token in a list: adr_sensitive_data; a list under password: flagged as before; [4111, 1111, 1111, 1111]: no card number; no logged value in the result |
✅ test_secrets_inside_lists_are_found: adr_sensitive_data on the email, the card number as a string and as a number, the Bearer token and password: ["***"]; none on [4111, 1111, 1111, 1111]; the result contains no logged value. A list of objects with a password key: still the nested-secret finding |
| 4 | init --from |
A list field (as stored_to) is declared type: string[], and check with the written file passes |
✅ test_init_from_declares_a_list_field: stored_to (["s3","pg"] and []) declared type: string[]; check with the written file: 0 violations |
| 5 | Same findings elsewhere | Full findings of v0.10.0 for examples/, databridge, yallmp-sync (2 captures, with a list field providers) and the sensitive-data corpus: identical; goldens unchanged |
✅ Full findings (rule, level, line, field, message, event) identical to v0.10.0: examples 15, databridge 481, yallmp-sync 3,084 and 3,084 (its providers list is undeclared, so missing_attribute as before), sensitive corpus 2,016. uv run pytest: 305 passed, including test_same_findings.py and the goldens (unchanged) |
| 6 | GenAI fields pass | Lines with gen_ai.provider.name, gen_ai.request.model, gen_ai.usage.input_tokens, gen_ai.usage.output_tokens, gen_ai.operation.name, gen_ai.tool.name, openai.response.service_tier, mcp.session.id (valid values): check --profile standard reports 0 violations. Every field GenAI v0.1.0 defines, checked one by one: no deprecated finding |
✅ tests/test_genai.py::test_claim6_genai_fields_pass: those fields plus gen_ai.request.top_k: 5: 0 violations. test_claim6_no_genai_field_is_deprecated: each of the 102 attributes GenAI v0.1.0 defines, one per line: no deprecated, no missing_attribute. Before the fix, the same check of all 70 fields that semconv 1.45.0 marks as moved gave 22 deprecated even with GenAI loaded, because Weaver picks a duplicate definition by group order |
| 7 | Old names | Each old name in the list above: deprecated with the new name in the message; gen_ai.token.type: deprecated; model: adr_banned_synonym and its hint gen_ai.request.model then passes |
✅ test_claim7_old_names_say_what_to_use: all 11 old names give deprecated; the 10 renamed ones name the new field (e.g. Replaced by \gen_ai.provider.name`.), gen_ai.token.typeisobsoleted; modelgivesadr_banned_synonymendinguse gen_ai.request.model, and a line with gen_ai.request.model: 0 violations. test_claim7_old_names_are_gone_from_genai_and_point_at_genai_fields`: no old name is in GenAI v0.1.0, every new name is |
| 8 | One definition | Weaver's resolve of logwarden's registry: no attribute declared twice, except the two identical aws.bedrock.* fields; the deprecated groups of semconv's gen-ai, mcp, openai are absent; findings don't change between runs |
✅ test_claim8_each_field_is_defined_once: the registry built for a run has no gen-ai, mcp, openai in its semconv copy; Weaver's resolve reports exactly two attributes declared twice, aws.bedrock.guardrail.id and aws.bedrock.knowledge_base.id. Live-check of the 70 moved fields, 8 runs: the same findings each time |
| 9 | Offline and pins | After logwarden setup, a check works with the network blocked; a wrong GenAI checksum is refused; LOGWARDEN_SEMCONV_GENAI is used when set; the Docker image built from this change checks a GenAI line with --network none; update_pins.py updates the GenAI pin and its SHA-256 |
✅ test_semconv.py::test_offline_after_first_run_and_env_override (network blocked after the first run; then LOGWARDEN_SEMCONV and LOGWARDEN_SEMCONV_GENAI with an empty cache); test_claim9_*: wrong GenAI checksum refused with nothing left in the cache, unpinned version refused, env var used, download cached; test_claim4_update_pins_rewrites: --genai 0.2.0 writes its SHA-256, the manifest pin and the schema_url read from the new archive. Image built from this change, --network none, run as uid 12345: the GenAI line passes, the old-names line gives the 3 deprecated and adr_banned_synonym. A small check takes about 0.11 s longer (median of 15 one-line checks, laptop: 0.244 s → 0.355 s; about half is copying the registries per run, half Weaver loading the larger registry; a first, single measurement said 0.25 s) |
| 10 | Same findings elsewhere | Full findings for examples/, databridge, yallmp-sync ×2 and the sensitive corpus vs v0.10.0: identical, except findings on gen_ai.* fields, each one listed and explained here |
✅ Identical to v0.10.0: examples 15, databridge 481, yallmp-sync 3,084 and 3,084 (these captures have no gen_ai.* fields). Sensitive-data corpus: 46 fewer findings, all deprecated on gen_ai.usage.input_tokens (a key in the corpus), nothing added; tests/golden/sensitive-corpus.json updated to that. Goldens (make golden): only mixed, the message of its gen_ai.system finding (reason = 'renamed', note = 'Replaced by \gen_ai.provider.name`.', was the "moved" note). uv run pytest`: 313 passed |
| 12 | Source lines with logging set up in conftest.py |
A pytest project whose conftest.py calls configure() at the top, run with LOGWARDEN_CAPTURE: the captured line has code.file.path (the test file) and code.line.number; this test fails before the fix. The existing case (configure() in the test module) still passes |
✅ tests/test_sarif.py::test_v0_10_2_callsite_when_logging_is_set_up_in_conftest: before the fix KeyError: 'code.file.path' on the captured line; after: the path ends with the test file's name and the line number is an int. test_claim1_pytest_plugin_turns_callsite_on (configure() in the test module) and tests/test_pytest_plugin.py pass |
| 13 | init --from hint |
A generated fields file: the dotted field (order.id) has the §2 hint, the bare field (cart_size) has none, and "namespaced" appears nowhere; rerunning keeps an edited description |
✅ tests/test_init_from.py::test_claim1_declares_custom_fields_only: order.id has "Dotted: the standard (§2)", cart_size has no hint, no "namespaced" in the file; test_claim1_rerun_adds_and_keeps_edits: the edited description of order.id survives a rerun. uv run pytest: 314 passed |
| 14 | Timestamp ids aren't cards | 20260911-120000, ui_draft/20261122-155600-0003, 20261122155009 and ids with dashes in non-card places (all Luhn-valid): no card finding. Public test card numbers of each issuer, contiguous and in card groups: a card finding each. The test fails before the fix. All findings on the five sample sets unchanged |
✅ tests/test_card_and_baseline.py::test_timestamp_ids_are_not_cards_and_cards_still_are: 0 of the 5 ids flagged, all 11 card numbers flagged; before the fix all 5 ids were flagged. Full findings (rule, level, line, field, message, event) for examples 15, databridge 481, yallmp-sync 3,084 ×2, the sensitive corpus 1,970: identical to before this change |
| 15 | A baselined secret kind doesn't hide another | Baseline a card number in query_params on Request completed; the same line: passes; a second line with a JWT in that field: fails with one finding, "a JWT", on line 2; the JWT isn't in the output. A baseline entry without kind: hides nothing, baseline_outdated 1, not counted as fixed, the text output says to regenerate. The tests fail before the fix |
✅ test_baselined_card_on_a_field_does_not_hide_a_jwt_there: the entry has kind: card_number; the same line passes; with the JWT line: exactly one finding, line 2, "a JWT"; the token is not in the JSON. test_secret_entries_from_older_baselines_hide_nothing: baselined 0, baseline_outdated 1, baseline_fixed 0, the text says "before v0.10.2" and "logwarden baseline". Before the fix all three tests failed. tests/test_baseline.py, test_review.py (--compare), test_inputs.py pass; goldens gain only "baseline_outdated": 0 |
| 16 | Python 3.10 unpacks the GenAI archive | With an empty cache on Python 3.10: GenAI v0.1.0 and semconv 1.45.0 download and unpack; links are skipped, .. and absolute paths still refused; the full suite passes on 3.10 |
✅ Python 3.10.20, empty LOGWARDEN_CACHE: both archives downloaded and unpacked (CI before the fix: "unsafe path in archive"). test_links_in_archive_skipped (symlink and hard link skipped, the file kept), test_unsafe_archive_paths_rejected (4 cases) pass. Full suite on 3.10 and 3.13: 317 passed |
| 11 | Docs, CI, release | docs/integration.md (list fields; GenAI offline copy), docs/standard.md (GenAI note), STABILITY.md (LOGWARDEN_SEMCONV_GENAI, the security exception), docs/rules.md (card numbers, baseline kind), AGENTS.md, the plugin skill (field naming); CI on Linux, macOS and Windows, speed job; dry run to TestPyPI; after the tag, PyPI and the image |
✅ Docs updated as listed, plus STABILITY.md (security exception) and docs/rules.md (card numbers, baseline kind); strict site build and make validate-plugin pass. PR #15 CI (Linux, macOS, Windows, Python 3.10, coverage, speed, recipes, Docker) passed; main CI 45123267384 after the version bump passed. Dry run and after the tag: see below |
Post-release checks
- ✅ Dry run 45123312852 (before the tag): TestPyPI
0.10.2.dev21, image:0.10.2.dev21. Main CI 45123267384 passed.uvx logwarden==0.10.2.dev21from TestPyPI: a line withgen_ai.provider.name,gen_ai.request.model,gen_ai.usage.input_tokensand the id20260911-120000: nodeprecated, no card number (onlyrefunknown, no fields file).