Skip to content

feat(blueprints): AI agent red-team probe harness - #4360

Merged
MartinRst merged 2 commits into
kestra-io:mainfrom
Varshith-Kali:blueprint/ai-agent-red-team-probe-harness
Oct 21, 2026
Merged

MartinRst merged 2 commits into
kestra-io:mainfrom
Varshith-Kali:blueprint/ai-agent-red-team-probe-harness

Conversation

@Varshith-Kali

Copy link
Copy Markdown
Contributor

What this is

A red-team harness blueprint that adversarially tests your own AI agent on a schedule. Guardrails rot: a system-prompt tweak or model upgrade can silently reopen an injection hole, and teams usually find out from an attacker. This flow fires a curated 12-probe battery across four attack families at the agent endpoint, scores every response for resistance, and escalates regressions.

How it works

  • Schedule + manual triggers: weekly Monday run plus an on-demand trigger for after system-prompt or model changes.
  • Probe battery (build_probe_battery): 12 probes across instruction overrides, prompt-extraction probes, jailbreaks, and sensitive-disclosure elicitation.
  • Probe firing (fire_probes): POSTs each probe to the agent endpoint and collects replies; falls back to a built-in fixture so the flow runs end to end without an endpoint.
  • Resistance scoring (score_responses): per-family and overall scores against min_score.
  • Gemini judge (judge_failure, concurrency-capped): confirms each weak family as a genuine regression versus scoring noise.
  • Parallel escalation: tracking GitHub issue plus Slack alert on regression; passing runs are recorded for the compliance trail.

Verification

The full Python chain was run end to end: 12 probes built, 12 responses collected, scored 75/100 against the 80 threshold with exactly the three designed failures (io-3 complied, pe-3 leaked the preamble, sd-3 leaked salaries; jailbreak family at 100). YAML validated (id matches filename, all 9 extend fields, metaDescription within limits). All plugin types are ones already used by merged blueprints. A live Kestra run was not possible in this environment (no Docker/credentials), which the fixture verification covers.

Checklist

  • Minimum 3 runnable tasks (8 tasks)
  • At least 1 flowable task (If, Loop, Parallel)
  • At least 1 trigger (Schedule + Manual)
  • At least 1 non-core plugin (github, slack, gemini)
  • Run at least once (fixture run above)
  • One PR per blueprint, file under flows/, extend block present

@github-project-automation github-project-automation Bot moved this to To review in Pull Requests Oct 19, 2026
@MartinRst

Copy link
Copy Markdown
Member

@Varshith-Kali the input firewall merged. On the red-team harness, io.kestra.plugin.core.trigger.Manual doesn't exist in Kestra, so the flow can't load. Any flow can already be run from the UI or API without a trigger, so just drop it. The branch also carries your merged PII gate; I've reset that file to main's version.

Weekly (and on-demand via UI or API) regression battery for LLM
agent guardrails: 12 probes across instruction override, prompt
extraction, jailbreak and sensitive-disclosure families are fired
at the agent endpoint under test, replies are scored for refusal
versus compliance per family, and a score below threshold opens a
GitHub issue and pages Slack. Closes the loop left open by the
input firewall and output gate: those guard one run, this checks
the agent still resists after every prompt or model change.
@Varshith-Kali
Varshith-Kali force-pushed the blueprint/ai-agent-red-team-probe-harness branch from 5a27d17 to f3c2f34 Compare October 20, 2026 12:37
@Varshith-Kali

Copy link
Copy Markdown
Contributor Author

Thanks @MartinRst, and thank you for merging the input firewall.

Both points are fixed on the red-team harness:

  • Dropped the manual_probe_run trigger (you are right, there is no Manual trigger type); the description now points to running the flow from the UI or API for on-demand runs. The weekly Schedule trigger stays.
  • The branch is rebased onto current main, so the PR now contains only the harness file; the already-merged firewall and PII gate no longer ride along.

Ready for another look whenever you are.

@MartinRst
MartinRst merged commit 55ee730 into kestra-io:main Oct 21, 2026
@github-project-automation github-project-automation Bot moved this from To review to Done in Pull Requests Oct 21, 2026
@MilosPaunovic MilosPaunovic added the kind/external Pull requests raised by community contributors label Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/external Pull requests raised by community contributors

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants