Repository navigation
feat: add ModelCallSimilarityGuard and deprecate SimilarityGuard - #1940
Conversation
f9da1d0 to
514aef9
Compare
514aef9 to
165e615
Compare
855afcb to
d2bc462
Compare
| "default model-call jailbreak" { | ||
| agents = ["planner-agent", "weather-agent"] | ||
| } | ||
| } |
There was a problem hiding this comment.
isn't this the same kind of configuration as a few lines up, but without the defaults? Do we need both?
Perhaps the "default model-call jailbreak" in reference.conf is not worth including, and we only document the full "jailbreak guard" config?
There was a problem hiding this comment.
What you mean by full 'jailbreak guard'?
Anyway, this extra piece is not needed. I will merge with the above, but let me know if you see it differently.
There was a problem hiding this comment.
The upper sample config is named "jailbreak guard".
I said full because it doesn't inherit any defaults from reference.conf
There was a problem hiding this comment.
I simplified the codes now. No mention on the previous or built-in.
Also no mention to the MCP limitation, because we are about to fix it as well.
There was a whole NOTE section that was not helping at all.
If someone have the old guadrails configured, they will get warnings in the logs. That should be enough to make them (or their agents) to check the docs and adapted accordingly.
|
🤖 review Findings
|
|
@patriknw, applied code fixes for code review comment |
patriknw
left a comment
There was a problem hiding this comment.
LGTM after moving the migration guide
| You can use this for other things than jailbreak attempt detection. | ||
|
|
||
| [#migrating-from-similarity-guard] | ||
| === Migrating from SimilarityGuard |
There was a problem hiding this comment.
I don't think we should have migration instructions in ordinary docs. We have one page for that: docs/src/modules/reference/pages/migration-guide.adoc
There was a problem hiding this comment.
Good one.
Migration moved now.
f574f7c to
3330435
Compare
The `SimilarityGuard` deprecation warning now names the deprecated uses the entry declares, with `*` expanded. It states that `SimilarityGuard` will support only the MCP uses, and that the SDK has no replacement for model-response. - For "default jailbreak", the warning lists the settings that differ from "default model-call jailbreak", so the user can copy them. - The last line tells the user to remove the agents and agent roles, or to keep only the MCP uses in use-for. - The warning for an agent with both similarity guards gives the same advice in place of "Keep only one".
The `@deprecated` note on `SimilarityGuard` now states the same facts as the startup warning. It covers model-response and says that `SimilarityGuard` will support only the MCP uses. The `reference.conf` comment on "default jailbreak" now limits the deprecation to model-request.
The guardrails page gets a migration section. It states which `SimilarityGuard` uses are deprecated and what replaces each one. It also explains how to move "default jailbreak" without losing changed settings. It lists the behaviour that differs after the move: the guard checks the masked user message, and the service fails at startup on a missing dataset or an out-of-range threshold.
3330435 to
62a399b
Compare
|
CI failed with what is likely unrelated. I created issue https://github.com/lightbend/akka-runtime/issues/5861 |
ModelCallSimilarityGuard binds to before-model-call by type and maps to the SPI SimilarityGuard marker.
Old SimilarityGuard on model-request logs a WARN naming the replacement.
reference.confships a disabled "default model-call jailbreak" entry and keeps the deprecated one.Depends on https://github.com/lightbend/akka-runtime/pull/5737