Reference
Architecture
TriageLab is deliberately small: one investigator, one standalone sandbox per run, local JSON/Markdown reports. There is no database, operator, custom sandbox runtime, or agent framework.
System map
Section titled “System map”Boundaries
Section titled “Boundaries”TRIAGELAB
- ticket routing + policy
- clarification reservations
- launch evidence binding
- bounded case inputs
- watchdog budgets
- evidence validation
- reports + cleanup
KAGENT
- investigator agent + tools
- sessions
- sandbox templates
- sandbox lifecycle
- model gateway
AGENT SUBSTRATE
- worker pools
- gvisor / microvm
- snapshots
- resource limits
- deny-by-default egress
cmd/triagelabis a testable standard-library CLI with injected writers.internal/casefiletreats descriptions, repositories, files, and logs as untrusted data. It collects bounded inputs and rejects dangerous file inputs before transferring bytes, without running repository programs on the host.internal/kagentis the only version-dependent transport layer: stateless MCP JSON-RPC, bounded HTTP, durable A2A event decoding, and the upstream task-cancellation extension. It never executes host commands.internal/investigationcoordinates one sandbox and one investigator session: input transfer, watchdog limits, evidence retrieval, reporting, and cleanup.internal/reportpersists private reports atomically and keeps independently collected process evidence separate from model hypotheses.internal/agentembeds the trusted investigator instructions and output schema. kagent executes the agent and its tools; TriageLab never simulates answers.internal/ticketflowprepares helpdesk and issue-tracker cases. Policy checks and durable clarification reservations stay outside the investigator. The ticket queue binds launches to exact evidence and run settings. Review is the default, and procedures can opt into automatic launch. External workflows can start standalone runs through the CLI or HTTP MCP.internal/webserverserves the UI and a bounded, loopback-only HTTP API. Credentials stay server-side and new runs route through the existing investigator.internal/authowns workspace sign-in: local accounts with PBKDF2 hashes in one JSON file, in-memory sessions, and one optional OIDC provider. Enforcement is server-side and fails closed.web/is a React 19 + TypeScript client with API transport, domain types, query hooks, and presentation kept separate. There is no second agent implementation or browser-held model credential.
kagent owns its native Agent/AgentTemplate/Harness, SandboxTemplate, runtime Session/Sandbox API, the Go ADK tool loop, authorization, the model gateway, and expiry. A standalone Sandbox is a database-backed API resource, not a Kubernetes CRD. Agent Substrate owns WorkerPools, Actors, gVisor or microVM isolation, snapshots, resource enforcement, and the default-deny egress gateway.
Evidence and lifecycle
Section titled “Evidence and lifecycle”- Allocate a case ID and write a private initial report.
- Create a standalone sandbox using that stable idempotency key. Repeat only the same lifecycle operation when pending or uncertain; never retry process starts.
- Upload bounded files and verify byte counts.
- Create an empty investigator session and persist its ID before invoking.
- Give the investigator the sandbox ID, limits, and an explicitly untrusted case.
- Poll durable task history. Accept canonical runtime tool parts — never ticket prose or user-role parts — as execution evidence. Pair call/result IDs and directly fetch each process’s state, exit code, and paginated output.
- Validate the structured answer and all evidence references. A failed infrastructure call is inconclusive; missing or truncated evidence cannot support a reproduced claim.
- Cancel active tasks, delete session and sandbox, retry pending lifecycle deletion, verify deleted state, and write final reports even on errors.
Process deadlines and experiment counts are client watchdog limits observed between API calls — not admission control. Per-request and overall deadlines, runtime resource limits, and server TTLs complement them. SIGKILL and network partitions may leave a sandbox until its TTL.
Why Go
Section titled “Why Go”Go provides a small deployable binary and fits the Kubernetes ecosystem. The
project uses cmd/ + internal/, explicit startup configuration, context
cancellation, and Make-based checks. TriageLab talks to the small pinned MCP
surface with net/http and encoding/json directly, avoiding the entire
upstream control plane or an SDK with a different MCP wire contract. The
vendored OpenTelemetry SDK is the only third-party Go dependency.
Non-goals
Section titled “Non-goals”There is no generic plugin framework, multiagent topology, database, job queue, custom Kubernetes operator, or production mutation tool. Additional reproduction images belong in upstream SandboxTemplates; egress exceptions belong in reviewed upstream EgressPolicy configuration — never in model output.