Product Architecture

How ART-Hub works

From login to lab submission — the data flow, the sandbox runtime, and the rules engine that grades every adversarial attempt.

Core data flow

A typical trainee journey from authentication to graded submission.

step 1
Trainee

Selects role, enters workspace.

step 2
Auth gateway

Issues scoped session token.

step 3
Sandbox engine

Spins isolated lab container.

step 4
Rules engine

Grades payload vs policy.

step 5
Progress store

Persists state & scores.

System diagram

              ┌──────────────────────────┐
              │       Web Client (UI)     │
              └─────────────┬────────────┘
                            │  HTTPS
              ┌─────────────▼────────────┐
              │      Auth Gateway        │
              │  (sessions · RBAC)       │
              └─────────────┬────────────┘
            ┌───────────────┼───────────────┐
   ┌────────▼─────────┐ ┌───▼────────┐ ┌────▼──────────┐
   │ Modules Service   │ │ Sandbox    │ │ Submissions   │
   │ (catalog · CRUD)  │ │ Orchestr.  │ │ Service       │
   └────────┬─────────┘ └───┬────────┘ └────┬──────────┘
            │               │                │
            │       ┌───────▼───────┐        │
            │       │ Lab Container │        │
            │       │ (isolated)    │        │
            │       └───────┬───────┘        │
            │               │ stdout/stderr  │
            └─────►┌────────▼────────┐◄──────┘
                   │  Rules Engine   │
                   │  (policy · YAML)│
                   └────────┬────────┘
                            │
                   ┌────────▼────────┐
                   │  Postgres + S3  │
                   └─────────────────┘

Rules engine

Each lab ships with a declarative policy file. The engine evaluates submissions against deterministic checks (regex, AST), heuristic checks (similarity), and dynamic checks (sandbox replay).

Static checks

Patterns, schemas, banned tokens.

Dynamic replay

Re-execute the payload in a clean sandbox.

Policy gates

Pass/Fail thresholds + human override.

rules/prompt-injection.yaml
module: prompt-injection
pass_score: 70
checks:
  - id: bypass_system_prompt
    type: dynamic
    weight: 40
    asserts:
      response.contains: "SECRET_FLAG"
  - id: defensive_patch
    type: static
    weight: 30
    asserts:
      submission.contains_any:
        - "allowlist"
        - "structured_output"
  - id: writeup_quality
    type: heuristic
    weight: 30
    rubric: clarity_and_specificity

Trust & isolation

Per-lab containers

Each session = fresh ephemeral runtime.

Egress controls

No outbound by default. Allowlist only.

Versioned rules

Policies live in Git. PR-reviewed.

RBAC

Trainee · Admin separation enforced server-side.