Skip to content
Docs
GitHub

Bashkit Repo Agent

Modify and verify a disposable repository through a sandboxed shell.

3 min readEdit on GitHub

Browse the complete example.

Cut a release in a disposable repository through the sandboxed Bashkit Shell, then verify every claimed change directly from the host. This is a real gpt-6.2-sol agent, not a scripted turn.

Bashkit Repo Agent terminal demo

How to mount a narrow read-write workspace, give an agent one execution capability, accept an interactive task, and treat independent host assertions as the success condition.

The bundled fixture is a two-crate Cargo workspace with three changelog fragments. The agent must cut release 0.2.0: update both package versions and the path-dependency pin, create today’s changelog section, preserve the 0.1.0 history, and remove the folded fragments.

After the turn, Rust code reopens the real working copy and fails the process if any invariant is false. A confident model answer cannot make a broken release pass.

Clone the repository and run from its root:

Terminal window
export OPENAI_API_KEY="your-key"
cargo run -p everruns-bashkit-repo-agent

Type the task interactively:

Terminal window
cargo run -p everruns-bashkit-repo-agent -- --interactive

The default workspace is temporary and removed on exit. Pass a scratch directory to inspect the result afterwards:

Terminal window
cargo run -p everruns-bashkit-repo-agent -- /tmp/release-run
cargo run -p everruns-bashkit-repo-agent -- --interactive /tmp/release-run

The configured model is gpt-6.2-sol. Provider access and funded credits are required; missing credentials, unsuccessful turns, and failed disk assertions exit nonzero.

Never pass a repository you care about: the example materializes its fixture into the target and the agent may change anything inside the mount.

Read-write access is explicit—the default workspace policy is read-only.

pub fn build(provider: impl Into<Provider>, workspace: &Path) -> Result<Agent, BuildError> {
Agent::builder()
.name("bashkit-repo-agent")
.instructions(include_str!("resources/instructions.md"))
.provider(provider)
.model(MODEL)
.max_iterations(12)
.workspace(workspace)
.workspace_policy(WorkspacePolicy::read_write())
.capability(BashkitShell::new())
.build()
}

The shared observer displays a bounded shell timeline and waits for a successful turn. The host then verifies the mounted files itself.

// OPENAI_API_KEY, declared by the OpenAI driver itself.
let agent = agent::build(everruns::OpenAI::from_env()?, &workspace)?;
let engine = Engine::new();
let session = engine.create(agent);
demo::run(&session, &request).await?;
verify_release(&workspace, &release_date)?;

Use session.send_and_wait(&request).await? when a live tool timeline is not needed.

Bashkit interprets shell scripts in-process against /workspace. The model gets no host filesystem outside that mount, network, Git credentials, or subprocess execution. Commands, loops, output, and script size are bounded. Repository text is treated as untrusted data rather than agent instructions.

Terminal window
cargo test -p everruns-bashkit-repo-agent
bash examples/bashkit-repo-agent/demo/record.sh --check

These checks validate argument handling, fixture state, host assertions, and the live-demo contract without provider credentials. They do not grade model quality.

The screencast types the release task into the interactive binary, displays real bashkit_shell calls, and ends with host-side checks over the mutated files. It does not replay prepared output. Read the captured transcript at your own pace.

With VHS, ffmpeg, a VHS-compatible browser, and funded OpenAI credentials:

Terminal window
bash examples/bashkit-repo-agent/demo/record.sh

The script uses OPENAI_API_KEY when exported, otherwise Doppler project everruns-dev, config dev. It updates the GIF and transcript only after the model turn and host verification succeed.

Replace the fixture, request acceptance criteria, and verifier together. Keep the mount disposable and narrow, start read-only unless mutation is required, and verify consequential claims outside the model/tool boundary.

This demonstrates one sandboxed repository mutation, not a general coding agent. It cannot fetch dependencies, run native programs, commit, or push. The Framework session is in-memory.