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 @@ -21,6 +21,7 @@ service keys.
| [A Stripe Link checkout with an SIE fraud-risk gate](./stripe-link-fraud) | Wiring all three SIE primitives into a pre-authorization fraud-risk gate that runs in the same round-trip as the Stripe PaymentIntent | `extract`, `encode`, `score` | Docker Compose plus Node UI; Stripe test-mode keys optional (runs in mock mode without them) | Runnable demo |
| [Vision-first document RAG](./vision-doc-rag) | Retrieving and answering questions over a multi-tenant page corpus by looking at page images — including scanned drawings — with OCR kept out of the score path | `encode`, `chat/completions`, `score` (optional) | GPU SIE deployment required: ColQwen2.5 retriever + Qwen3.5-4B answer model (runs on the generation bundle) | Runnable demo |
| [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 |
| [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
10 changes: 10 additions & 0 deletions examples/agent-action-monitor/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copy to .env and fill in values only when overriding the local defaults.
# Never commit .env.

# 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
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