-
Notifications
You must be signed in to change notification settings - Fork 50
Feat: add AgentTrust evaluation demo #516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
leeyamin
wants to merge
1
commit into
rossoctl:main
Choose a base branch
from
leeyamin:agenttrust-evaluation-demo
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+157
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # AgentTrust Evaluation Demo | ||
|
|
||
| Run an [AgentTrust](https://github.com/leeyamin/agent-trust) evaluation as a Kubernetes Job. AgentTrust evaluates whether an AI agent's behavior aligns with its declared capabilities by probing it across in-scope, out-of-scope, and near-miss requests. | ||
|
|
||
| This demo is report-only — results are logged but no action is automatically enforced. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - A Kubernetes cluster with kubectl access | ||
| - A running A2A agent with an Agent Card endpoint | ||
| - An Anthropic API key for the LLM judge (AgentTrust uses the Claude Agent SDK, which also supports Vertex AI and Bedrock via Claude Code CLI configuration) | ||
|
|
||
| ## Setup | ||
|
|
||
| ### 1. Create the credentials secret | ||
|
|
||
| ```bash | ||
| kubectl create secret generic agenttrust-judge-credentials \ | ||
| --from-literal=ANTHROPIC_API_KEY=<your-key> | ||
| ``` | ||
|
|
||
| See `secret.example.yaml` for the expected format. | ||
|
|
||
| ### 2. Configure the evaluation | ||
|
|
||
| Edit `configmap.yaml` to set the target agent and evaluation parameters: | ||
|
|
||
| | Variable | Default | Description | | ||
| |----------|---------|-------------| | ||
| | `AGENT_URL` | `http://weather-agent.agents.svc:8000` | A2A endpoint of the target agent | | ||
| | `AGENTTRUST_NUM_PROBES` | `5` | Probes per scope | | ||
| | `AGENTTRUST_TRACE_SOURCE` | `none` | `mlflow` or `none` | | ||
| | `MLFLOW_EXPERIMENT_NAME` | `agenttrust-evaluations` | MLflow experiment name | | ||
| | `CLAUDE_CONFIG_DIR` | `/work` | Writable directory for CLI session data | | ||
|
|
||
| For the full list of configuration options, see the [AgentTrust CLI Reference](https://github.com/leeyamin/agent-trust#cli-reference). | ||
|
|
||
| ### 3. Deploy | ||
|
|
||
| ```bash | ||
| kubectl apply -k demos/agenttrust-evaluation/ | ||
| ``` | ||
|
|
||
| ### 4. View results | ||
|
|
||
| ```bash | ||
| kubectl logs job/agenttrust-evaluation | ||
| ``` | ||
|
|
||
| The Job outputs a compact JSON result to stdout: | ||
|
|
||
| ```json | ||
| { | ||
| "schemaVersion": "v1", | ||
| "evaluationId": "abc-123", | ||
| "agent": "weather_agent", | ||
| "cardHash": "sha256:...", | ||
| "outcome": "completed", | ||
| "alignmentPassed": true, | ||
| "score": 85, | ||
| "evidenceMode": "text", | ||
| "completedAt": "2026-01-01T00:00:00+00:00", | ||
| "reportURI": null | ||
| } | ||
| ``` | ||
|
|
||
| | Field | Description | | ||
| |-------|-------------| | ||
| | `outcome` | `completed` or `error` | | ||
| | `alignmentPassed` | `true` if score >= alignment threshold | | ||
| | `score` | Trust score (0-100) | | ||
| | `evidenceMode` | `text` or `text+trace` | | ||
| | `reportURI` | MLflow report URI when `MLFLOW_TRACKING_URI` is set | | ||
|
|
||
| ## Cleanup and rerun | ||
|
|
||
| ```bash | ||
| kubectl delete job agenttrust-evaluation | ||
| kubectl apply -k demos/agenttrust-evaluation/ | ||
| ``` | ||
|
|
||
| K8s Jobs are immutable — delete before re-applying. | ||
|
|
||
| ## Security | ||
|
|
||
| - Only evaluate sandboxed agents with read-only tools | ||
| - The container runs as non-root with a read-only filesystem | ||
| - No Kubernetes API permissions are granted to the pod | ||
| - No evaluation result is automatically enforced — results are informational only | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: agenttrust-evaluation-config | ||
| data: | ||
| AGENT_URL: "http://weather-agent.agents.svc:8000" | ||
| AGENTTRUST_NUM_PROBES: "5" | ||
| AGENTTRUST_TRACE_SOURCE: "none" | ||
| MLFLOW_EXPERIMENT_NAME: "agenttrust-evaluations" | ||
| CLAUDE_CONFIG_DIR: "/work" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| apiVersion: batch/v1 | ||
| kind: Job | ||
| metadata: | ||
| name: agenttrust-evaluation | ||
| spec: | ||
| backoffLimit: 0 | ||
| activeDeadlineSeconds: 900 | ||
| template: | ||
| spec: | ||
| restartPolicy: Never | ||
| securityContext: | ||
| runAsNonRoot: true | ||
| runAsUser: 65532 | ||
| runAsGroup: 65532 | ||
| fsGroup: 65532 | ||
| containers: | ||
| - name: agenttrust | ||
| image: ghcr.io/leeyamin/agenttrust:latest | ||
| envFrom: | ||
| - configMapRef: | ||
| name: agenttrust-evaluation-config | ||
| - secretRef: | ||
| name: agenttrust-judge-credentials | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| readOnlyRootFilesystem: true | ||
| capabilities: | ||
| drop: | ||
| - ALL | ||
| resources: | ||
| requests: | ||
| cpu: 500m | ||
| memory: 512Mi | ||
| limits: | ||
| cpu: "1" | ||
| memory: 1Gi | ||
| volumeMounts: | ||
| - name: work | ||
| mountPath: /work | ||
| - name: tmp | ||
| mountPath: /tmp | ||
| volumes: | ||
| - name: work | ||
| emptyDir: {} | ||
| - name: tmp | ||
| emptyDir: {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| kind: Kustomization | ||
| resources: | ||
| - configmap.yaml | ||
| - job.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: agenttrust-judge-credentials | ||
| type: Opaque | ||
| stringData: | ||
| ANTHROPIC_API_KEY: "REPLACE_ME" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small thing, could we move the agenttrust-evaluation demo under the existing demos directory here: https://github.com/rossoctl/operator/tree/main/operator/demos . After that we should be good to merge :))