Repository navigation
feat(ai): rate impact and sensitive data of AI actions - #2210
irvingouj@Devolutions (irvingoujAtDevolution) merged 6 commits into
Conversation
Reviewers want to find the risky actions in a long session first. The model now rates each action low (viewing), medium (changing something) or high (destroying something, restarting a system, resetting a password, unlocking an account, or viewing sensitive data), and the `.slog` action line carries it as `"sensitivity"`. The level is a fixed English word whatever the analysis language, so viewers can translate it. A missing or unknown level leaves the field out and keeps the action. Readers that don't know the field ignore it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Let maintainers know that an action is required on their side
|
One level mixed two questions: how much the action changed, and how sensitive the data it touched was. A read of `/etc/shadow` and a deleted temp file both came out "high" for different reasons, and a reviewer couldn't tell which. The action line now carries `impact` (`low`: changed nothing, `medium`: easy to undo, `high`: hard to undo or affects security) and `sensitiveData: true` when the action showed or touched secrets, credentials or personal data. A viewer can still show a single level from the two. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A failed delete was rated by what it changed, so it came out "low" and a reviewer jumping to the high-impact actions would miss the attempt. The model now rates a failed action by what it tried to do. The language rule now keeps the "impact" words in English, so an analysis in another language can't turn them into words the parser drops. A dropped impact is logged at debug level. The screen prompt's password reset example now sets "sensitiveData", matching its own definition. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The impact and sensitive data fields had no rule behind them, so their tests could only be scaffolding. The intent now says what each means, that both are a best-effort triage hint and never a security verdict, that Gateway never merges them into one level, and that an unreadable rating is dropped while the action stays. The tests cite that section. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Intent drafts: handoffInterview read branch Provenance
Left out on purpose
PlacementAll five in Pending experimentsNone. Note Human-tuned, LLM-assisted content. |
There was a problem hiding this comment.
🟡 Changes recommended
Object-valued impact ratings are incorrectly accepted and assigned a real triage label instead of being omitted, and a committed comment violates the repository’s provenance rule.
2 open issues
What changed in this PR
Adds separate impact and sensitive-data hints to AI-generated session actions, helping reviewers prioritize risky activity without treating model ratings as security verdicts.
Changes:
- Updates terminal and screen prompts to request English impact levels and an optional sensitive-data flag.
- Carries ratings through action parsing, checkpoints, and
.slogoutput. - Documents rating semantics and adds parsing, serialization, and persistence tests.
| File | Description |
|---|---|
crates/devolutions-gateway-ai/src/session_summary.rs |
Updates test fixtures with unrated defaults. |
crates/devolutions-gateway-ai/src/session_actions.rs |
Adds rating types, prompt instructions, parsing, and tests. |
crates/devolutions-gateway-ai/src/screen_actions.rs |
Requests ratings for screen-derived actions. |
crates/devolutions-gateway-ai/src/recording_analysis/slog.rs |
Writes optional rating fields to action events. |
crates/devolutions-gateway-ai/src/recording_analysis/checkpoint.rs |
Preserves ratings across checkpoint saves and reloads. |
crates/devolutions-gateway-ai/INTENT.md |
Defines independent, best-effort rating semantics. |
Review effort: Balanced
The doc comments on `Impact` now say a failed action is rated by what it tried to do, as the prompt and the intent do. A dropped impact logs at trace level, since it can repeat on every line. The slog test name says which values are written. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Serde reads `{"low":null}` as the `low` variant, so a malformed rating
became a real triage label instead of being dropped. Only a JSON string
is now read as an impact. The intent no longer carries a provenance
comment, which belongs to the pull request rather than the file.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
040e7af
into
master


Paul asked for a sensitivity level on each event of the AI session log, so reviewers can jump to the risky stuff first. That's really two questions, so the action line gets two fields:
impact: what the action did, or tried to do when it failed.lowchanged nothing,mediumis easy to undo,highis hard to undo or affects security (delete, restart, password reset, unlock).sensitiveData: truewhen the action showed or touched secrets, credentials or personal data. Left out otherwise.{"timestamp":"...","seq":3,"event":"session.action","description":"Read /etc/shadow","object":"/etc/shadow","impact":"low","sensitiveData":true,"source":"ai"}Both are a best-effort triage hint from the model, not a security verdict, and Gateway never merges them into one level: a viewer shows them side by side. The rules are in the crate's
INTENT.md(#action-rating).low.summary,source) through the parser'sunknownFields.Tested with the crate's unit tests (
cargo test -p devolutions-gateway-ai --lib, 117 pass).🤖 Generated with Claude Code