# Run Bash Commands in Agents

> Run approved bash commands and scripts inside Space Agents with safe access to your app files.

- Source: https://www.taskade.com/learn/agents/bash-sandbox
- Section: AI Agents
- Updated: 2026-09-02
- Index of all pages: https://www.taskade.com/learn/llms.txt

## Overview

The bash sandbox lets [Taskade EVE](https://www.taskade.com/learn/agents/eve-assistant) and any Space Agent run approved commands against your app files in a safe, contained environment. Build small scripts, run quick checks, and have an agent execute them straight from chat.

> **TL;DR:** Bash inside Space Agents runs commands against your app files in a sandbox. Use it for one-shot checks, repeatable scripts, and on-demand utilities. Output flows back into the chat thread so the agent can act on results. Pair with [Custom AI Agents](https://www.taskade.com/learn/agents/custom-agents) for a fully scripted teammate.

## When to use the bash sandbox

Reach for bash when an agent needs to:

- Inspect or transform a file inside your Taskade Genesis app
- Run a repeatable script (lint, test, validate, format)
- Read a binary file like a PDF or image and pipe results into the next step
- Stitch together small utilities the agent does not have a built-in tool for

For everyday data shaping, prefer the [Utility Actions](https://www.taskade.com/learn/automation/utility-actions) so you stay declarative.

## Validate a CSV before it lands

Say you run member onboarding and a partner sends over a 1,200-row CSV. Before those rows touch your live member list, ask the agent to run a quick check. It runs the script inside the sandbox and reports back in the chat thread:

```text
┌────────────────────────────────────────────────┐
│  🤖 Onboarding Agent  ›  Bash Sandbox           │
├────────────────────────────────────────────────┤
│  You: validate new-members.csv before import   │
│                                                │
│  $ wc -l new-members.csv                       │
│  1,204 rows                                    │
│  $ python validate.py new-members.csv          │
│  ⚠  3 rows missing email                       │
│  ⚠  1 duplicate member ID (row 812)            │
│  ✓  1,200 rows ready to import                 │
│                                                │
│  Agent: 4 rows need a fix. Import the clean    │
│  1,200 now, or fix all first?                  │
└────────────────────────────────────────────────┘
```

Fix the flagged rows, re-run, and import only when the file is clean. The check runs in the sandbox, so a bad file never reaches your [live project data](https://www.taskade.com/learn/projects/databases) until you say go.

## Set up bash for an agent

1. Open the agent's edit screen.
2. Scroll to **Tools** and enable **Bash Sandbox**.
3. Pick the directories the agent can read or write inside the sandbox.
4. Save and test by asking the agent to run a quick command.

The sandbox respects your workspace permissions, so an agent only sees what you grant it.

## Safety controls

- Commands run inside an isolated sandbox, not on your host machine.
- Reads and writes stay scoped to the directories you select.
- Output streams back into chat so you can audit every step.
- Long-running commands hit a safety timeout to keep the sandbox responsive.

## Binary file support

The sandbox reads binary files like images, PDFs, and audio by default. Agents can run a PDF text extractor, scan a screenshot, or summarize a media file without leaving the workflow. Pair with [Image Generation](https://www.taskade.com/learn/automation/image-generation) to close the loop on visual workflows.

## Related guides

- [Taskade EVE Assistant](https://www.taskade.com/learn/agents/eve-assistant). How Taskade EVE orchestrates tools and skills.
- [Custom AI Agents](https://www.taskade.com/learn/agents/custom-agents). Build agents with specialized tools.
- [Agent Knowledge](https://www.taskade.com/learn/agents/knowledge). Train an agent on your documents.
- [Agent Skills](https://www.taskade.com/learn/agents/agent-skills). Persisted slash-commands for repeat workflows.
- [Agent Tools](https://www.taskade.com/learn/agents/agent-tools). All the tools an agent can call.
