-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix(safety): redact model-bound secrets without rejecting turns #7509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
3f84562
fix(loop): allow security prose in recovered context
serrrfirat 48f72f7
test(turns): align prompt safety contract coverage
serrrfirat 5899d4b
fix(loop): address review feedback on prompt recovery (#7434)
serrrfirat 0f27f54
Merge remote-tracking branch 'origin/main' into codex/review-7434-178…
serrrfirat e71995b
fix(loop): reject filler-separated credentials (#7434)
serrrfirat 4b53502
Merge remote-tracking branch 'origin/main' into fix-pr-7434-conflicts
serrrfirat 6847653
fix(safety): redact model-bound secrets without rejecting turns
serrrfirat b5a4713
fix(safety): preserve non-secret sha256 fingerprints
serrrfirat 484fb9b
test(safety): align channel context with gateway redaction
serrrfirat 6eff8b9
fix(gateway): address coderabbit review — preserve redacted JSON shap…
serrrfirat 570abd5
fix(safety): redact quoted structured credentials
serrrfirat 940ea74
fix(safety): scan encoded tool result content
serrrfirat 25dd109
fix(safety): redact structured credential values
serrrfirat 269c020
fix(safety): redact character-dump credentials
serrrfirat 7e66ee0
fix(safety): close provider-bound redaction gaps (#7509)
serrrfirat 1d899b0
Merge remote-tracking branch 'origin/main' into codex/fix-thread-reco…
serrrfirat 0feeac5
fix(safety): close structured redaction review gaps (#7509)
serrrfirat 362966a
fix(safety): redact nested schema and URL fragment secrets (#7509)
serrrfirat 63dfe88
Merge remote-tracking branch 'origin/main' into codex/fix-thread-reco…
serrrfirat 5dfb18a
Merge remote-tracking branch 'origin/main' into codex/fix-thread-reco…
serrrfirat 36e5873
Merge remote-tracking branch 'origin/main' into codex/fix-thread-reco…
serrrfirat c4ec257
test(integration): align prompt trust expectation (#7509)
serrrfirat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
crates/contracts/ironclaw_host_api/tests/model_result_preview_contract.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| use ironclaw_host_api::model_result_preview::ModelResultPreview; | ||
| use serde_json::json; | ||
|
|
||
| #[test] | ||
| fn redacts_nested_and_malformed_structured_credentials() { | ||
| let canary = "never-before-uploaded-canary-host-contract"; | ||
| let malformed = json!({ | ||
| "marker": "safe-context", | ||
| "content": format!(r#"1| {{"password":"{canary}"}}]"#), | ||
| }) | ||
| .to_string(); | ||
| let mut deeply_nested = json!({"password": canary}); | ||
| for _ in 0..20 { | ||
| deeply_nested = json!([deeply_nested]); | ||
| } | ||
| let deep = json!({"marker": "safe-context", "content": deeply_nested.to_string()}).to_string(); | ||
|
|
||
| for input in [malformed, deep] { | ||
| let preview = ModelResultPreview::redacted(input).expect("preview is redacted"); | ||
| assert!(preview.as_str().contains("safe-context")); | ||
| assert!(!preview.as_str().contains(canary)); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 IronLoop review · Inline finding
🔴 High · Redact unstructured credential assignments before masking their labels
The added paired-value pass runs only when the whole preview parses as JSON. A raw paged result such as `password: hunter2` falls through to marker-only redaction, yielding `[redacted]: hunter2`; the later provider-bound scanner no longer has the credential label and leaves the weak value intact. Raw `result_read` previews can take this path and reach a later provider request. Redact paired values (or fail closed) before masking labels for top-level unstructured previews.