Skip to content

fix(evaluation): redact non-public model identities in execution evidence - #430

Open
freshyjmp wants to merge 8 commits into
NVIDIA:mainfrom
freshyjmp:jonp/redact-local-model-paths
Open

freshyjmp wants to merge 8 commits into
NVIDIA:mainfrom
freshyjmp:jonp/redact-local-model-paths

Conversation

@freshyjmp

@freshyjmp freshyjmp commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #321, addressing @lfengad's review comment on execution evidence.

Problem: the identity check let absolute paths through, so a locally served checkpoint (for example /home/example/private-run/checkpoint-123) ended up in requested.model, requested.model_revision, observed.model, operator profile identities and the aggregate observed_models / requested_settings.

Policy now:

  • Model names are recorded only if publicly approved: nvidia/Cosmos3-Nano by default, plus exact names listed in COSMOS_EVIDENCE_PUBLIC_MODELS (comma-separated). Everything else, including local paths and internal names, becomes redacted.
  • Revisions are recorded only as commit hashes (7–64 hex) or unknown. Branches, tags and paths become redacted.
  • Aggregation re-applies the policy. aggregate_execution_records redacts a copy of each record under the current allowlist before building observed_models and requested_settings, so records saved by older versions can't leak identities into the summary. The caller's records are not modified.
  • Debugging: an opt-in execution_identity_dir gets a separate per-response file with the original identities ("sanitized": false, mode 0600, directory 0700). The constructor rejects it if it equals, contains, or is inside execution_evidence_dir, so sharing either tree can't include the other.

Unchanged: evidence for nvidia/Cosmos3-Nano at its pinned revision is identical to before, so the published launchable baselines are not affected.

Checked with a throwaway script:

  • Both example paths from the original comment, used as model, revision and profile identity, appear nowhere in the per-response record or the aggregate.
  • A record built by the base revision (non-public name + branch revision) comes out redacted in the new aggregate; an allowlisted name is kept; Nano's aggregate is unchanged.
  • Same directory, private-inside-evidence, evidence-inside-private and a .. path to the same directory are all rejected; sibling directories work.
  • _record_execution with and without execution_identity_dir: the evidence directory never contains the original path, and the private file appears only when opted in.

README's execution-evidence section documents the policy.

…ence

Local checkpoint paths and internal model names passed the old identity check and were kept in requested.model, requested.model_revision, observed.model, operator profile identities and the aggregates. Model names are now recorded only if publicly approved (nvidia/Cosmos3-Nano, plus exact names in COSMOS_EVIDENCE_PUBLIC_MODELS), and revisions only as commit hashes or 'unknown'; anything else becomes 'redacted'. Unredacted identities can be written to a separate opt-in execution_identity_dir for debugging.

Addresses review feedback on NVIDIA#321.

Signed-off-by: Jon Patterson <jonp@nvidia.com>
Signed-off-by: Jon Patterson <jonp@nvidia.com>

@lfengad lfengad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default writer redacts model identities correctly in my local check. Please also apply that policy when aggregating previously saved records before merging. The directory check below is a separate hardening suggestion.

return {'format_version': 1,
'requested': {'model': _identity(payload.get('model')), 'generation': generation,
'model_revision': _identity(requested_model_revision),
'requested': {'model': _model_identity(payload.get('model')), 'generation': generation,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please apply the same identity filters inside aggregate_execution_records before building observed_models and grouping requested_settings. I passed a record produced by the base revision to the new aggregator. Both the synthetic non-public model name and its branch revision appeared verbatim in the summary, with debugging disabled. Re-sanitizing a copy of requested.model, requested.model_revision and observed.model at aggregation time would also honor the operator’s current allowlist when older records are reused.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 3a3202c: aggregate_execution_records now re-applies the identity policy to a copy of each record before building observed_models and requested_settings, so it uses the current allowlist. Checked with a record built by the base revision (non-public name + branch revision): both come out redacted in the summary, the caller's record isn't mutated, and Nano's aggregate is unchanged.

requested_model_revision=revision)
writes = [(self.execution_evidence_dir, record)]
if self.execution_identity_dir is not None:
writes.append((self.execution_identity_dir, private_identity_record(payload, raw, revision)))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional hardening: when I configured both output directories to the same temporary directory, it contained two response JSONs, one with the original model name. A private directory nested under the evidence directory would also be included when that tree is shared. Consider resolving both paths and rejecting overlapping directories before writing either file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done too: the constructor resolves both paths and raises if execution_identity_dir equals, is inside, or contains execution_evidence_dir (also caught via .. paths). Separate sibling directories still work. README updated for both.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One remaining case on c481674: the constructor checks the expanded, absolute paths, but _record_execution writes using the original strings. With execution_evidence_dir="." and execution_identity_dir="~/private" in a working directory outside home, validation sees two separate directories. At write time, Path(target) treats ~ as a literal directory name, so the unredacted file lands under ./~/private/ inside the evidence tree. Please store the two resolved paths on the instance after validation and use those same paths for both writes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, fixed in c7fe0c5. Both directories are now expanded and resolved once in the constructor and stored on the instance; the overlap check and both writes use those same paths. Checked your case (evidence ., identity ~/private, cwd outside home): no literal ./~ is created, the private file lands in the real ~/private, and nothing with the original model path appears under the evidence tree. Overlaps written via ~, ./ or an absolute path to the same place are still rejected; sibling directories still work.

…lapping evidence dirs

aggregate_execution_records now re-applies the model/revision policy to copies of each record, so records saved by older versions or under another allowlist cannot leak identities into observed_models or requested_settings. The constructor rejects an execution_identity_dir that equals, contains, or is inside execution_evidence_dir.

Addresses review feedback on NVIDIA#430.

Signed-off-by: Jon Patterson <jonp@nvidia.com>
…el-paths

Signed-off-by: Jon Patterson <jonp@nvidia.com>
…overlap-checked

The constructor checked expanded absolute paths but _record_execution wrote with the raw strings, so execution_identity_dir='~/private' with evidence '.' outside home landed in ./~/private inside the evidence tree. Both directories are now resolved once and stored; the check and all writes use them.

Addresses review feedback on NVIDIA#430.

Signed-off-by: Jon Patterson <jonp@nvidia.com>
…el-paths

Signed-off-by: Jon Patterson <jonp@nvidia.com>
@yaoxu-crypto yaoxu-crypto added the Eval Evaluation harness or benchmark changes label Dec 2, 2026
@yaoxu-crypto yaoxu-crypto added Skill New skill or updating existing skill and removed Skill New skill or updating existing skill labels Dec 3, 2026

@satishra-ai satishra-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #430 is good to merge at e7a0bc7. All 9 independent CPU checks passed. I verified that new evidence and aggregates of older records redact private model identities, public Nano evidence matches the base revision, and opt-in debug files stay in a separate directory.

The tests used real file writes and a mocked HTTP endpoint

…el-paths

Signed-off-by: Jon Patterson <jonp@nvidia.com>
@yaoxu-crypto yaoxu-crypto added the Skill New skill or updating existing skill label Dec 3, 2026
…el-paths

Signed-off-by: Jon Patterson <jonp@nvidia.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Eval Evaluation harness or benchmark changes Skill New skill or updating existing skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants