Python: enforce FIDES labels on expanded variables - #8139
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Approval canonicalization rejects supported enum arguments, while breaking behavior and function-loop integration coverage also need resolution.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds FIDES enforcement for labels retained by expanded hidden variables and binds approvals to resolved invocation snapshots.
Changes:
- Resolves hidden references with integrity/confidentiality labels.
- Enforces argument policies and session ownership.
- Adds approval replay and isolation tests.
File summaries
| File | Description |
|---|---|
security.py |
Implements resolution, policy enforcement, session scoping, and approval binding. |
test_security.py |
Tests variable policies, session isolation, and approval replay. |
FIDES_DEVELOPER_GUIDE.md |
Documents sessions and hidden-variable forwarding. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 3
- Review effort level: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: No findings
Scope: full PR (1 commit(s)): 1424d287c59b
Model: gpt-5.6-sol-fast
Overview
The change resolves owned hidden-variable references together with their labels, evaluates policy against the combined context and argument labels, and binds approvals to strict original and resolved invocation snapshots. Session ownership checks, task-local scope activation, strict durable serialization, fail-closed approval binding, and focused tests for cross-session access and replay changes provide concrete guardrails. No PR-introduced Critical, High, or Medium defect remained after reconciliation.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.
1424d28 to
ecf3072
Compare
Code Coverage OverviewLanguages: Python Python / code-coverage/pythonThe overall line coverage in commit 052698c in the Show a line coverage summary of the most covered files.
Updated |
ecf3072 to
ae67556
Compare
ae67556 to
5e19c84
Compare
Bind expanded hidden values to their stored integrity and confidentiality labels, enforce sink policy without tainting model context, and persist exact approval digests across session restore. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve no-session middleware compatibility with run-local state, support enum approval arguments, recover superseded policy approvals safely, and keep mixed function results in valid tool-role messages. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep pending-approval lookup side-effect free so runs without approvals do not persist a server-owned approval bucket.\n\nCo-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
843765b to
052698c
Compare
Motivation & Context
FIDES can hide untrusted tool output behind variable references, but expanding those references into later tool arguments previously lost the stored labels. A sink could therefore receive hidden untrusted or confidential content while policy evaluated only the model-visible conversation.
Description & Review Guide
Related Issue
Part of #7455. Depends on #8138 and is the second layer of a four-PR FIDES hardening stack.
Contribution Checklist
breaking changelabel (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.