Skip to content

Commit 60610e9

Browse files
committed
Add Daytona computer-use runtime verification
1 parent 1add898 commit 60610e9

9 files changed

Lines changed: 1091 additions & 21 deletions

File tree

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export FIRECRAWL_API_KEY=... # optional web search
2828
export PITHOS_PROVIDER=openai # any Pi provider
2929
export PITHOS_MODEL=gpt-5.1
3030
export PITHOS_SANDBOX_MODE=docker # docker (default) or local
31+
export PITHOS_COMPUTER_USE=daytona # optional live computer-use backend
3132
```
3233

3334
## Run
@@ -45,12 +46,17 @@ GH_TOKEN=... pithos run https://github.com/owner/private-repo --model gpt-5.5
4546
pithos run /path/to/repo --model gpt-5.5 --no-advisories
4647
FIRECRAWL_API_KEY=... pithos run git@github.com:owner/repo.git --model gpt-5.5 --web
4748
pithos run /path/to/repo --model gpt-5.5 --sandbox-mode local
49+
pithos run /path/to/repo --model gpt-5.5 --execute-app --computer-use daytona
4850
```
4951

5052
Static scan agents use `--sandbox-mode docker` by default. Use `--sandbox-mode
5153
local` only inside a disposable outer environment such as Daytona, an ephemeral
5254
CI worker, or a throwaway VM; local mode runs `pi` directly and does not provide
53-
PITHOS-managed process isolation.
55+
PITHOS-managed process isolation. `--computer-use daytona` keeps static review
56+
source-only, then uses a hosted Daytona sandbox with computer-use support for
57+
live verification when `--execute-app` is set. It overrides the runtime profile's
58+
sandbox backend for that run, so generated Docker profiles do not need to be
59+
edited just to try Daytona.
5460

5561
## Live Verification
5662

@@ -91,6 +97,30 @@ pithos run /path/to/repo \
9197
--runtime-profile /path/to/repo/.pithos/runtime.yaml
9298
```
9399

100+
Run live verification in Daytona:
101+
102+
```bash
103+
export DAYTONA_API_KEY=...
104+
pithos run /path/to/repo \
105+
--provider google \
106+
--model gemini-2.5-pro \
107+
--execute-app \
108+
--computer-use daytona \
109+
--runtime-profile /path/to/repo/.pithos/runtime.yaml
110+
```
111+
112+
Daytona profiles can declare optional computer-use settings:
113+
114+
```yaml
115+
environment:
116+
daytona:
117+
snapshot: daytonaio/sandbox:0.6.0
118+
record: true
119+
verification:
120+
computer:
121+
enabled: true
122+
```
123+
94124
If setup is incomplete, PITHOS writes `verify/RUNTIME-SETUP.md` with the missing
95125
env vars, personas, mocks, or profile fields. Live verification does not load
96126
`.env.local` or other env files; secrets must come from the process environment
@@ -108,6 +138,8 @@ Artifacts are written under `results/<repo>/<timestamp>/`:
108138
- `verify/environment-summary.json`
109139
- `verify/RUNTIME-SETUP.md` when live setup is incomplete
110140
- `verify/runtime-summary.json`
141+
- `verify/<finding-id>/computer-session.json` for Daytona computer-use sessions
142+
- `verify/<finding-id>/recording.json` for Daytona screen recording metadata
111143
- `run-summary.json`
112144

113145
## Notes

docs/output.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ recorded in the advisory artifacts and run summary.
4040
the Pi agent path is used.
4141
- `verify/<finding-id>/agent-command.json`: command/setup log when a profile-declared
4242
`verification.agent_command` is used.
43+
- `verify/<finding-id>/computer-session.json`: Daytona sandbox/computer-use session metadata
44+
when `--computer-use daytona` is used.
45+
- `verify/<finding-id>/computer-events.jsonl`: Daytona computer-use lifecycle events.
46+
- `verify/<finding-id>/recording.json`: Daytona recording metadata when recording is enabled.
47+
- `verify/<finding-id>/recording.mp4`: downloaded Daytona screen recording when available.
4348

4449
By default, PITHOS does not execute the target application. Source-oracle and SQL
4550
checks can still confirm or disprove findings using deterministic inspection.
@@ -76,9 +81,27 @@ verification:
7681
execute_app: true
7782
```
7883
79-
`environment.sandbox` accepts `docker` or `local`. Docker is isolated and remains
80-
the default; local runs setup commands and live verification agents directly in
81-
the current environment, so use it only inside a disposable outer sandbox.
84+
`--sandbox-mode` accepts `docker` or `local`. Docker is isolated and remains the
85+
default; local runs setup commands and live verification agents directly in the
86+
current environment, so use it only inside a disposable outer sandbox.
87+
`--computer-use daytona` keeps static review source-only, then uses a hosted
88+
Daytona sandbox for live verification when `--execute-app` is set. Profiles may
89+
also set `environment.sandbox: daytona` for checked-in runtime configuration.
90+
Passing `--computer-use daytona` overrides the profile sandbox backend for that
91+
run.
92+
93+
Daytona requires `DAYTONA_API_KEY` and can enable computer-use recording:
94+
95+
```yaml
96+
environment:
97+
sandbox: daytona
98+
daytona:
99+
snapshot: daytonaio/sandbox:0.6.0
100+
record: true
101+
verification:
102+
computer:
103+
enabled: true
104+
```
82105

83106
Secret values should come from the shell, CI secret store, or Cursor-style
84107
environment secrets. The profile should name variables, not contain secret

pithos/cli.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
DEFAULT_PROVIDER = "azure-openai-responses"
3333
DEFAULT_SANDBOX_MODE = "docker"
34+
COMPUTER_USE_BACKENDS = ("daytona",)
3435
AZURE_AUTH_MSG = (
3536
"error: no Azure OpenAI auth found. Set:\n"
3637
" AZURE_OPENAI_API_KEY (required)\n"
@@ -163,6 +164,12 @@ def main(argv: list[str] | None = None) -> int:
163164
"outer environment"
164165
),
165166
)
167+
p_run.add_argument(
168+
"--computer-use",
169+
choices=COMPUTER_USE_BACKENDS,
170+
default=os.environ.get("PITHOS_COMPUTER_USE"),
171+
help="Enable a computer-use backend for live verification (currently: daytona)",
172+
)
166173
p_run.add_argument("--votes", type=int, default=DEFAULT_REPO_VOTES)
167174
p_run.add_argument("--max-findings", type=int, default=12)
168175
p_run.add_argument(
@@ -278,6 +285,13 @@ def _cmd_run(args: argparse.Namespace) -> int:
278285
f"error: invalid sandbox mode {args.sandbox_mode!r}; choose {allowed}", file=sys.stderr
279286
)
280287
return 1
288+
if args.computer_use and args.computer_use not in COMPUTER_USE_BACKENDS:
289+
allowed = ", ".join(COMPUTER_USE_BACKENDS)
290+
print(
291+
f"error: invalid computer-use backend {args.computer_use!r}; choose {allowed}",
292+
file=sys.stderr,
293+
)
294+
return 1
281295

282296
pi_config_dir = sandbox.resolve_pi_config_dir(args.pi_config_dir)
283297
agent_env, auth_error = _resolve_agent_env(args.provider, pi_config_dir)
@@ -313,6 +327,7 @@ def _cmd_run(args: argparse.Namespace) -> int:
313327
"provider": args.provider,
314328
"model": args.model,
315329
"sandbox_mode": args.sandbox_mode,
330+
"computer_use": args.computer_use,
316331
"advisories": args.advisories,
317332
"web": allow_web,
318333
"execute_app": args.execute_app,
@@ -328,6 +343,8 @@ def _cmd_run(args: argparse.Namespace) -> int:
328343
print(f" provider: {args.provider}", file=out)
329344
print(f" model: {args.model}", file=out)
330345
print(f" sandbox: {args.sandbox_mode}", file=out)
346+
if args.computer_use:
347+
print(f" computer: {args.computer_use}", file=out)
331348
if pi_config_dir:
332349
print(f" pi config: {pi_config_dir}", file=out)
333350
print(f" advisories: {args.advisories}", file=out)
@@ -369,6 +386,7 @@ def _cmd_run(args: argparse.Namespace) -> int:
369386
agent_env=agent_env,
370387
pi_config_dir=pi_config_dir,
371388
sandbox_mode=args.sandbox_mode,
389+
computer_use=args.computer_use,
372390
env_audit_report=env_audit_report,
373391
event_sink=event_sink,
374392
)
@@ -402,6 +420,7 @@ def _cmd_run(args: argparse.Namespace) -> int:
402420
agent_env=agent_env,
403421
pi_config_dir=pi_config_dir,
404422
sandbox_mode=args.sandbox_mode,
423+
computer_use=args.computer_use,
405424
preflight_result=runtime_preflight,
406425
env_audit_report=env_audit_report,
407426
event_sink=event_sink,

0 commit comments

Comments
 (0)