Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ service keys.
| [Multi-model contract review with the OpenAI Agents SDK](./contract-review-agent) | Running an OpenAI Agents SDK agent whose every model call (triage, orchestration, vision, OCR, embeddings, rerank, entity extraction, text-to-SQL, reasoning, and a safety guardrail) is served by one SIE cluster, each step on the right catalog model, with per-model observability | `chat/completions`, `encode`, `score`, `extract` | GPU SIE deployment required; standalone `uv` project; real contracts fetched from CUAD (CC BY 4.0) | Runnable demo |
| [Turn difficult PDFs into Markdown](./document-to-markdown) | Preserving tables, reading order, headings, and form labels across real financial, academic, and government PDFs | `extract` | SIE endpoint with `docling`; standalone `uv` project; source PDFs fetched at run time | Runnable evaluation example |
| [Review a flood claim packet](./insurance-claims-agent) | Finding an unsigned form and a $400 evidence mismatch across a policy, estimate, inventory, and damage photograph | `extract`, `score`, `chat/completions` | GPU SIE deployment; standalone `uv` project; public FEMA documents and public-domain photograph fetched at run time | Runnable agent example |
| [A behavioural gate that catches hijacked AI agents by their actions, not their credentials](./agent-action-monitor) | Judging a proposed AI agent action against that agent's own learned baseline in real time, before it reaches a downstream system | `encode`, `score`, `extract` | Docker Compose (gate + self-hosted SIE + n8n + mock downstream), no API key required | Runnable demo |

For docs publishing, lead with the quickest runnable demos, then use the
benchmark and evaluation examples for deeper technical users.
Expand Down
24 changes: 24 additions & 0 deletions examples/agent-action-monitor/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Never send secrets or unnecessary files into the Docker build context,
# even though each Dockerfile only COPYs specific paths -- the whole context
# is still uploaded to the daemon otherwise.
.env
.env.*
!.env.example

.git/

__pycache__/
*.py[cod]
*.egg-info/
.venv/
venv/
.pytest_cache/
.coverage
.mypy_cache/
.ruff_cache/

tests/

.idea/
.vscode/
.DS_Store
20 changes: 20 additions & 0 deletions examples/agent-action-monitor/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copy to .env and fill in values only when overriding the local defaults.
# Never commit .env. docker compose reads this file automatically for the
# ${VAR} interpolation in compose.yml -- values here reach the containers
# without editing compose.yml itself.

# SIE is self-hosted by default and needs no key. Set SIE_API_KEY only for
# an authenticated hosted endpoint.
DUSK_SIE_ENDPOINT=http://sie:8080
SIE_API_KEY=
DUSK_SIE_ENCODE_MODEL=BAAI/bge-m3
DUSK_SIE_SCORE_MODEL=BAAI/bge-reranker-v2-m3
DUSK_SIE_EXTRACT_MODEL=urchade/gliner_multi-v2.1

# agent-demo defaults to a mock Bedrock client and needs none of this. Set
# USE_REAL_BEDROCK=true on the agent-demo service in compose.yml (or an
# override file) and fill these in to call real Bedrock instead.
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_SESSION_TOKEN=
AWS_REGION=us-east-1
43 changes: 43 additions & 0 deletions examples/agent-action-monitor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Python build and package artifacts
__pycache__/
*.py[cod]
*.egg-info/
*.egg
build/
dist/
.eggs/

# Virtual environments
.venv/
venv/
env/

# Test, coverage, and type-checking artifacts
.pytest_cache/
.coverage
htmlcov/
.tox/
.mypy_cache/
.ruff_cache/

# Runtime state generated by the example
dusk-alerts.json
dusk-decisions.json
trace-decisions.json
dusk-offense-memory.json
state/

# Generated test fixtures
tests/fixtures/*.pcap
tests/fixtures/*.json
tests/fixtures/*.jsonl

# Local secrets; keep the documented template
.env
.env.*
!.env.example

# Editors and operating-system metadata
.idea/
.vscode/
.DS_Store
26 changes: 26 additions & 0 deletions examples/agent-action-monitor/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# dusk-gate: the /v1/gate HTTP service (core gate + SIE client + trace + n8n).
# 3.12+ because sie-sdk requires it; the package's own >=3.11 floor is for installs without it.
FROM python:3.12-slim

WORKDIR /app

COPY pyproject.toml README.md ./
COPY src/ ./src/

RUN pip install --no-cache-dir -e ".[sie]" \
&& useradd --create-home --uid 1000 dusk \
&& mkdir -p /app/state \
&& chown -R dusk:dusk /app

USER dusk

ENV FLASK_HOST=0.0.0.0 \
FLASK_PORT=8000 \
DUSK_DEMO_INTEGRATIONS=false

EXPOSE 8000

HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \
CMD ["python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health', timeout=3)"]

CMD ["python", "-m", "dusk.api"]
Loading