Skip to content

Python: preserve confidentiality through FIDES security tools - #8141

Merged
Evan Mattson (moonbox3) merged 5 commits into
mainfrom
python-fides-label-correctness
Sep 9, 2026
Merged

Python: preserve confidentiality through FIDES security tools#8141
Evan Mattson (moonbox3) merged 5 commits into
mainfrom
python-fides-label-correctness

Conversation

@eavanvalkenburg

Copy link
Copy Markdown
Member

Motivation & Context

Hidden content can be safely passed into a transformation after the preceding layer, but result labeling must preserve confidentiality independently from integrity. Security tools must also publish the labels of the content they actually expose or derive rather than relying on generic fallback metadata.

Description & Review Guide

  • What are the major changes? Preserves PRIVATE and USER_IDENTITY confidentiality through transformed and embedded-label results, publishes authoritative labels from inspect_variable and quarantined_llm, updates cumulative confidentiality for fully hidden results without integrity taint, and distinguishes internal quarantine wrappers from ordinary response-shaped JSON.
  • What is the impact of these changes? Trusted transformations cannot implicitly declassify hidden inputs, inspection errors do not falsely taint integrity, and quarantine output remains UNTRUSTED at the combined input confidentiality.
  • What do you want reviewers to focus on? Please focus on the separation of integrity precedence from confidentiality joins and the narrow quarantine payload-shape recognition.

Related Issue

Part of #7455. Depends on #8139 and is the third layer of a four-PR FIDES hardening stack.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and the title prefix in sync automatically.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Quarantine payload detection still relies on forgeable JSON structure and can truncate ordinary hidden payloads.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Preserves FIDES confidentiality labels through transformations, inspection, quarantine, and hidden results.

Changes:

  • Propagates input confidentiality independently of integrity precedence.
  • Publishes authoritative labels for security-tool results.
  • Narrows quarantine payload recognition and expands regression coverage.
File summaries
File Description
security.py Updates label propagation and security-tool parsing.
test_security.py Adds confidentiality and quarantine regression tests.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread python/packages/core/agent_framework/security.py Outdated

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

MAF Automated Review — Iteration 1

Result: Findings reported
Scope: full PR (3 commit(s)): a01e735957c3, c36fcae00970, 446bfed4c263
Model: gpt-5.6-sol-fast

Overview

The PR makes result confidentiality monotonic across hidden inputs and embedded labels, adds authoritative parsers for the security tools, and narrows quarantine payload recognition; focused tests cover those intended invariants. Two residual trust-boundary failures remain: reflected inspect_variable errors can override untrusted invocation provenance, and malformed optional label metadata can discard otherwise valid integrity and confidentiality fields.

Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
2 verified findings remained after source verification (1 high, 1 medium) across 1 file. Details are attached to the affected lines below.

Affected areas: python/packages/core/agent_framework/security.py

Comment thread python/packages/core/agent_framework/security.py Outdated
Comment thread python/packages/core/agent_framework/security.py
Comment thread python/packages/core/agent_framework/security.py
@github-code-quality

github-code-quality Bot commented Sep 8, 2026

Copy link
Copy Markdown

Code Coverage Overview

Languages: Python

Python / code-coverage/python

The overall line coverage in commit d800337 in the python-fides-label-c... branch is 91%. Line coverage data for the main branch is not yet available.

Show a line coverage summary of the most covered files.
File main python-fides-label-c... d800337 +/-
packages/core/a...work/_skills.py 95%
packages/core/a...ework/_tools.py 94%
packages/core/a.../_compaction.py 94%
packages/core/a...rk/_sessions.py 94%
packages/core/a...ework/_types.py 93%
packages/core/a...bservability.py 93%
packages/openai..._chat_client.py 92%
packages/core/a...amework/_mcp.py 91%
packages/ag-ui/...i/_agent_run.py 91%
packages/core/a...ork/security.py 85%

Updated September 09, 2026 10:13 UTC

Keep resolved-input confidentiality on transformed and embedded-label results, publish authoritative inspect/quarantine labels, and avoid unwrapping ordinary response-shaped JSON.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Resolve the stacked PR2/PR3 boundary so hidden arguments are expanded once, retain their combined label for policy, and preserve their confidentiality on transformed results.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use middleware provenance for quarantine unwrapping, require explicit label fields, fail unknown quarantine inputs closed, and scope trusted inspect errors to clean parser-marked invocations.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@eavanvalkenburg

Copy link
Copy Markdown
Member Author

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

MAF Automated Review — Iteration 2

Result: Findings reported
Scope: full PR (4 commit(s)): 7dbd951b3efc, c894ae48c4c5, c730173f6009, 384489e14ab5
Model: gpt-5.6-sol-fast

Overview

The change cleanly separates integrity precedence from confidentiality joins, preserves mandatory label fields when optional metadata is malformed, and uses internal markers plus scope-owned metadata to narrow result handling. The expanded tests cover hidden transformation inputs, malformed labels, inspection errors, and labeled quarantine inputs. One residual path allows a quarantine call with no labeled payload to publish PUBLIC confidentiality and override the tool's PRIVATE fallback, including for placeholder, model, and exception-derived output.

Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
1 verified finding remained after source verification (1 medium) across 1 file. Details are attached to the affected lines below.

Affected areas: python/packages/core/agent_framework/security.py

Comment thread python/packages/core/agent_framework/security.py
Use the existing UNTRUSTED/PRIVATE fail-closed label when quarantined_llm receives no labeled input, with placeholder and configured-client regressions.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@moonbox3
Evan Mattson (moonbox3) added this pull request to the merge queue Sep 9, 2026
Merged via the queue into main with commit 63e6c9a Sep 9, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants