Agent with Tracked Capabilities · LAMP / EPFL

A safety-first coding agent enforced by Scala 3 capabilities.

ATC runs agent-generated Scala 3 snippets in a persistent sandboxed REPL. Static capability checking and Classified[T] boundaries verify code before execution, while the host enforces layered deny-by-default permissions at runtime.

Enforcement
Scala 3 Capture Checking
Policy
Layered, deny-by-default
Privacy
Classified[T]
License
Apache-2.0
atc · acme-service
read-only
ATC v0.2.4
Agent with Tracked Capabilities
modelclaude
moderead-only
directory~/acme-service
read-only > add a "review the tests" item to TODO.md
● run_scala
│ append("TODO.md", "- review the tests\n")
├ error
│ Found: (fs : atc.lib.FileSystem^{io.rd})
│ Required: atc.lib.FileSystem^{any}
│ … it cannot subsume a read-only capture set
└ failed 84 ms
● I am in read-only mode, so I cannot write TODO.md. Switch to /mode local or Shift-Tab and I will add the line.

01 · Safety Architecture

Verifiable guarantees, not prompt instructions.

System prompts can be bypassed by prompt injection or model mistakes. ATC enforces authority, permissions, and confidentiality at the type-checker and host-runtime layers.

Static Capability Discipline

Every file mutation, subprocess, and HTTP request demands an explicit Scala 3 capability (FileSystem^, Exec^, Network^). Safe mode blocks ambient JDK APIs, and capture checking forbids temporary capabilities from escaping their lexical scope.

Layered, Deny-by-Default Permissions

Nothing is pre-authorized in the binary. Global and explicit (-c) policies can grant access, while repository configs are confined to their own tree and can only tighten global limits. Unpermitted operations prompt via scoped request* blocks, while locked rules and deny lists reject immediately.

Type-Enforced Privacy Preservation

Sensitive paths stay wrapped in Classified[T]. Because callbacks in map may capture only read-only capabilities, leaking secrets to logs, files, or HTTP fails to compile; the LLM only ever observes Classified(***) while your terminal renders [classified].

Auditable REPL & Local Privacy

Every snippet is concise, inspectable Scala 3 checked by a pre-compile lexical validator and restricted class loader. API keys stay owner-only in ~/.atc/keys.properties, project grants beyond file rules require explicit trust, and local endpoints like Ollama or vLLM can be configured by base URL.

02 · Core Mechanisms

Inspect every boundary in real Scala 3.

Select a mechanism to see the Scala 3 types, compiler diagnostics, and policy semantics that govern the sandbox.

Scala 3 REPL · read-only Compile-time rejected
// Top-level helpers in atc.lib.Interface:
def read(path: String)(using FileSystem): String
def write(path: String, content: String)(using FileSystem^): Unit

// FileEntry handles inherit the view of `fs` (read-only here):
val e: FileEntry^{fs} = fs.access("notes.md")
e.read()                       // compiles through either view
e.write("hello")               // update def: needs full capability

Cannot call update method write of e
since its capture set {e} is read-only.

Read-only views propagate across helper functions and file handles. Even if a model attempts a write in read-only mode, the Scala 3 capture checker rejects the snippet before bytecode is produced.

03 · Developer Interfaces

Native in the terminal. First-class in VS Code.

Both interfaces drive the same capability-checked Scala 3 sandbox with live diffs, interactive permission prompts, and explicit visual markers for classified data.

Interactive Terminal (TUI)

Keyboard-first workflow with inline slash commands, live turn steering, and resumable sessions.

? atc · my-scala-app
local
> install dependencies and run the test suite
● run_scala
│ requestExec(Set("npm *"), "install dependencies and run the test suite") {
│ println(exec("npm", List("install")).stdout.takeRight(400))
│ println(exec("npm", List("test")).stdout.takeRight(2000))
│ }
⚠ Permission request: Run commands
reason:install dependencies and run the test suite
command 1:npm *
note:* matches any arguments; for an interpreter, any code
Click or use ↑/↓, 1–5, Esc to test the permission dialog

Fast Keyboard Ergonomics

Inline / command completion, Shift-Tab mode switching, Ctrl-O expanded diffs, and 1–5 permission shortcuts.

Live Steering & Background Monitors

Send mid-turn corrections while tools run, inspect or stop background watchers with /monitors, and resume auto-saved sessions.

Non-Interactive JSONL Mode

Run single non-interactive turns with atc -p "…" --output json for CI pipelines and structured tooling.

VS Code Extension

Persistent atc --ide JSONL integration with inline diffs, approval cards, and schema-validated configuration.

Interactive preview — click approval buttons or editor tabs
atc-project — Visual Studio Code
ATC atc --ide · local
Verify secrets/api.env has a live key without exposing it, and enable strict mode in BillingConfig.scala.
Run readClassified & replaceExact src/BillingConfig.scala 48 ms
val key = readClassified("secrets/api.env")
println(key.map(_.trim.startsWith("sk-live")))
replaceExact("src/BillingConfig.scala", "strict = false", "strict = true")
🔒 Classified true model observes Classified(***)
+1 -1
- strict = false,
+ strict = true,
⚠ Permission request: Run commands
command./mill app.test
reasonverify BillingConfig tests
Verify read-only mode blocks writes… Tab
+ claude ▾ local
11%
 1 package acme.billing
 2
 3 final case class BillingConfig(
 4   endpoint: String,
 5   strict: Boolean,
 6   maxRetries: Int
 7 )
 8
 9 object BillingConfig:
10   val default: BillingConfig = BillingConfig(
11     endpoint = "https://api.acme.example/v2",
12     strict = true,
13     maxRetries = 3
14   )
⎇ main ⊗ 0   ⚠ 0
ATC: local · claude · 11% Scala 3

Turn Rail & Clickable Diffs

Collapsible Scala 3 REPL runs, distinct purple 🔒 Classified strips, and one-click side-by-side Git diffs.

Inline Approval & Onboarding

Approve scoped permissions, skills, and project trust inline; configure providers and models in the tabbed settings sheet.

Workbench & Schema Integration

Right-click to explain selections, fix diagnostics, or run Scala in the shared REPL, plus IntelliSense for .atc/config.json.

04 · Capability Model

Two capability roots. Three sandbox modes.

Machine effects derive from io; conversation effects derive independently from user. Switching modes restricts what the agent can express without discarding conversation history.

Runtime.rootIO Machine effects root io: IOCap^ capture root fs: FileSystem^{io} Read files; mutate only with full view read-only · local · full mem: Memory^{io} Private persistent & classified memories read-only · local · full ex: Exec^{io} Permitted subprocesses & env rules local · full net: Network^{io} Allow-listed HTTP & secretHeaders full Runtime.rootUser Decoupled UI root user: UserIO^ println · ask · setTodos · chat (always in scope)
Mode FileSystem Memory Exec Network Intended Use
read-only FileSystem^{io.rd} Memory^{io.rd} — — Codebase inspection, review, and auditing with zero mutation authority
local FileSystem^{io} Memory^{io} Exec^{io} — Editing, refactoring, and running allow-listed build or test commands without agent Network capability
full FileSystem^{io} Memory^{io} Exec^{io} Network^{io} Documentation lookup, allow-listed APIs, and provider web search

Enforced by the Sandbox

  • No ambient authority: Agent Scala compiles only with capabilities explicitly in scope.
  • Non-escaping scopes: Borrowed request* capabilities cannot outlive their block.
  • Deny precedence: denyCommands, denyHosts, and denyEnv override every allow rule and grant.

Explicit Trust Boundaries

  • Authorized commands run with OS privileges: Approve narrow subcommands (git status, ./mill app.test), never bare shells.
  • Isolated classified models: Configure classifiedModel only for an offline local model; by default it stays unset.
  • Side channels & experimental TCB: Confidentiality tracking is termination-insensitive (timing/resource side channels are out of scope), and Scala 3 capture checking and safe mode are experimental compiler features alongside the JVM, OS, and host.

05 · Quick Start

Install once. Connect any provider or local model.

Requires JDK 17+. The launcher verifies release SHA-256 digests from GitHub Releases and walks through first-run provider and project setup.

bash / zsh
curl -fsSL https://raw.githubusercontent.com/lampepfl/atc/refs/heads/main/atc -o atc
chmod +x atc
./atc setup

Opens a guided setup and installs ~/.local/bin/atc. In a new terminal, run cd ~/my-project && atc.