Skip to content

feat(ai): rate impact and sensitive data of AI actions - #2210

Merged
irvingouj@Devolutions (irvingoujAtDevolution) merged 6 commits into
masterfrom
feat/ai-action-sensitivity
Nov 20, 2026
Merged

irvingouj@Devolutions (irvingoujAtDevolution) merged 6 commits into
masterfrom
feat/ai-action-sensitivity

Conversation

@irvingoujAtDevolution

@irvingoujAtDevolution irvingouj@Devolutions (irvingoujAtDevolution) commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

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. low changed nothing, medium is easy to undo, high is hard to undo or affects security (delete, restart, password reset, unlock).
  • sensitiveData: true when 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).

  • Always English words, so viewers translate them, same as the field names.
  • Missing or bad value: the field is left out, the action stays. No rating means not rated, never low.
  • Old readers just ignore both. The DVLS viewer already reads AI-only fields (summary, source) through the parser's unknownFields.

Tested with the crate's unit tests (cargo test -p devolutions-gateway-ai --lib, 117 pass).

🤖 Generated with Claude Code

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]>
@github-actions

Copy link
Copy Markdown

Let maintainers know that an action is required on their side

  • Add the label release-required Please cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module) when you request a maintainer to cut a new release (Devolutions Gateway, Devolutions Agent, Jetsocat, PowerShell module)

  • Add the label release-blocker Follow-up is required before cutting a new release if a follow-up is required before cutting a new release

  • Add the label publish-required Please publish libraries (`Devolutions.Gateway.Utils`, OpenAPI clients, etc) when you request a maintainer to publish libraries (Devolutions.Gateway.Utils, OpenAPI clients, etc.)

  • Add the label publish-blocker Follow-up is required before publishing libraries if a follow-up is required before publishing libraries

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]>
@irvingoujAtDevolution irvingouj@Devolutions (irvingoujAtDevolution) changed the title feat(ai): rate the sensitivity of each action in the AI log feat(ai): rate the impact and sensitive data of each action in the AI log Nov 20, 2026
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]>
@irvingoujAtDevolution

irvingouj@Devolutions (irvingoujAtDevolution) commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Intent drafts: handoff

Interview read branch feat/ai-action-sensitivity at 7f24f0ebe; the drafts landed in 69d6174a6.

Provenance

# Commitment as written Human's words (if tidied) Level
1 Each session.action may carry an impact ... and sensitiveData: true ... "I agree" 3
2 Both are the model's best-effort hint ... a low action is not proven harmless. "I agree" 3
3 Gateway writes the two separately and never combines them into one level ... "I agree" 3
4 A rating outside these values is dropped and the action is kept without it ... "agree, let's do it" 3
5 A missing rating means the action was not rated, never that it is low. "agree, let's do it" 3

Left out on purpose

  • The impact words stay English in any language: in the prompt (LANGUAGE_RULE), ruled by "go ahead and fix all please"; not asked as intent.
  • Debug vs warn log for a dropped rating: implementation detail.
  • Cross-session filtering by rating, RDM display: DVLS / RDM scope, not this crate.

Placement

All five in crates/devolutions-gateway-ai/INTENT.md, new section <a id="action-rating"></a> #### Action rating, after "Analyze Recording".

Pending experiments

None.

Note

Human-tuned, LLM-assisted content.

@irvingoujAtDevolution
irvingouj@Devolutions (irvingoujAtDevolution) marked this pull request as ready for review November 20, 2026 16:42
Copilot AI balanced review requested due to automatic review settings November 20, 2026 16:42

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

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 .slog output.
  • 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

Comment thread crates/devolutions-gateway-ai/INTENT.md Resolved
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]>
@irvingoujAtDevolution irvingouj@Devolutions (irvingoujAtDevolution) changed the title feat(ai): rate the impact and sensitive data of each action in the AI log feat(ai): rate the impact of each AI log action Nov 20, 2026
@irvingoujAtDevolution irvingouj@Devolutions (irvingoujAtDevolution) changed the title feat(ai): rate the impact of each AI log action feat(ai): rate impact and sensitive data of AI actions Nov 20, 2026
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]>
kristahouse

This comment was marked as outdated.

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.

LGTM

@irvingoujAtDevolution
irvingouj@Devolutions (irvingoujAtDevolution) merged commit 040e7af into master Nov 20, 2026
55 checks passed
@irvingoujAtDevolution
irvingouj@Devolutions (irvingoujAtDevolution) deleted the feat/ai-action-sensitivity branch November 20, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants