Commit 2274ca8
authored
feat(evaluators): add defenseclaw evaluator (#248)
## Summary
Added two global external evaluator integrations:
- `defenseclaw.rule_pack`
- `defenseclaw.opa_policy`
- Added strict, typed Pydantic configuration models and distinct JSON
Schemas.
- Added dedicated Agent Control UI forms with canonical serialization of
hidden protocol fields.
- Both evaluator execution paths are intentionally no-ops and do not
install or invoke DefenseClaw OSS packages.
## Scope
**User-facing/API changes:**
- Both evaluators appear independently in `GET /api/v1/evaluators`.
- Added typed UI forms for rule-pack and OPA-policy configuration.
- Rule-pack forms support adding and removing rules.
- Fixed protocol fields remain hidden in Form mode but are always
serialized.
- DefenseClaw configurations are preserved in `get_server_controls()`
output.
**Internal changes:**
- Added the `agent-control-evaluator-defenseclaw` contrib package.
- Added evaluator entry-point registration and package/release wiring.
- Added strict nested validation, including unique rule IDs and
confidence bounds.
- Added default configurations and UI registry entries.
- Added focused backend and UI tests.
**Out of scope:**
- DefenseClaw transport, authentication, or provider invocation.
- Installing or calling DefenseClaw OSS packages.
- Changes to the separate `~/code/ui` Galileo UI repository.
- Orbit production packaging changes.
## Risk and Rollout
**Risk level:** medium
**Primary risk:**
- The evaluator package must be installed in the server runtime for
catalog discovery and server execution.
- It must also be installed in SDK runtimes for controls using
`execution: "sdk"`.
**Rollout requirements:**
- Publish `agent-control-evaluator-defenseclaw`.
- Add the package to the Orbit Agent Control image dependencies.
- Verify both evaluator identifiers appear in `GET /api/v1/evaluators`
before activating controls.
**Rollback plan:**
- Remove or disable controls referencing the DefenseClaw evaluator
names.
- Remove the DefenseClaw package from runtime dependencies.
- Revert the evaluator registry and UI form registration changes.
## Testing
- [x] Added or updated automated tests
- Ran `make check` (full repository check was not run).
- Ran 26 focused Python tests successfully.
- Ran Ruff and mypy successfully.
- Ran TypeScript, ESLint, and Prettier checks successfully.
- Verified contrib package wiring, evaluator registration, and server
catalog schemas.
- Playwright could not run in the sandbox because it could not bind the
local UI server port.
- [x] Manually verified behavior
- Registration and generated catalog schemas were verified
programmatically.
- Full browser-based Form/JSON interaction should be verified locally
using the supplied testing guide.
## Checklist
- [ ] **Linked issue/spec**
- Technical spec: `defenseclaw-external-evaluators-technical-spec.md`
- Add the appropriate issue/spec URL before merging.
- [x] **Updated docs/examples for user-facing changes**
- Added the contrib package README.
- Created a first-time local setup and testing guide.
- [x] **Included required follow-up tasks**
- Add DefenseClaw packaging to `~/code/orbit`.
- Implement the corresponding forms in `~/code/ui`.
- Run the full Playwright suite.
- Install the evaluator package in every SDK runtime that evaluates
DefenseClaw controls.1 parent 83188b6 commit 2274ca8
31 files changed
Lines changed: 1159 additions & 7 deletions
File tree
- evaluators
- builtin
- tests
- contrib/defenseclaw
- src/agent_control_evaluator_defenseclaw
- opa_policy
- rule_pack
- tests
- ui
- src/core
- evaluators
- defenseclaw
- page-components/agent-detail/modals
- add-new-control
- edit-control
- tests
- evaluators
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
| |||
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
90 | | - | |
| 93 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
0 commit comments