Trae Agent: safety, tool access and how to run it
How ByteDance's open source trae-agent CLI runs commands, its optional Docker mode, config and trajectory files, and steps to run it safely.
- Made by
- ByteDance
- Runs in
- Terminal (trae-cli)
- Platforms
- macOS, Linux, Windows (a Windows fix to the bash session is in the commit history)
- Licence
- MIT, open source
1 reported issue, no advisories
Security advisories and reported issues since 2025, from vendor advisories, NVD and public reports. Checked December 2, 2026.
On this page
What Trae Agent is
Trae Agent is a Python CLI (trae-cli) that takes a task, plans steps with a model, and runs tools such as bash and a file editor to finish it. It supports OpenAI, Anthropic, Google Gemini, OpenRouter, Doubao, Ollama and Azure, records each run as a JSON trajectory, and can load MCP servers from its config. Trae is also the name of ByteDance's separate AI IDE (TraeCode on trae.ai), which is a different product with its own agent. The repository README does not mention the IDE, and the CLI is MIT-licensed.
Install Trae Agent
From source with uv:
git clone https://github.com/bytedance/trae-agent.git && cd trae-agent && uv sync --all-extras && source .venv/bin/activateCheck the config it loaded:
trae-cli show-configTrae Agent news and advisories
Releases and announcements, with public security advisories on the same line.
- Advisory
An open issue (#604) reports that tool names that normalize to the same string can run the wrong exact-name tool. A second issue (#601) says a JSON encoding failure can truncate a file during an agent edit. Both are reported bugs, not advisories, and no fix was seen.
GitHub issue tracker The newest commit visible on main fixed the OpenAI client so tool outputs are kept in message history.
trae-agent commit historyA fix stopped a Rich markup error when error messages contained square brackets.
trae-agent commit historyDocker mode got bug fixes and a README update, five days after it was added.
trae-agent commit historyDocker mode was added, with options to run in a new container, attach to one, or build from a Dockerfile.
trae-agent commit history
How Trae Agent keeps itself in bounds
Out of the box, runs its tools, including bash and file edits, directly on your machine without asking, unless you use Docker mode.
| Mode | How to turn it on | Asks you | What it allows |
|---|---|---|---|
Default run | trae-cli run "<task>" | Never | Runs its tools in the working directory. Set the folder with --working-dir and cap work with --max-steps. |
Interactive mode | trae-cli interactive | Never | A conversation loop with status, help, clear and exit commands. It has no approval step for tool use. |
Docker mode | --docker-image <image>, --docker-container-id, --dockerfile-path, --docker-image-file; --docker-keep keeps the container | Never | Runs the task in a container instead of on your host. This is the only isolation option the README documents. |
Patch generation | --must-patch | Never | Forces the run to end with a patch, which suits review before you apply anything. |
Where its settings live
| Path | What it holds |
|---|---|
trae_config.yaml | Agents, providers, models, tools and MCP servers. Copy it from trae_config.yaml.example. It is git-ignored, and tabs are not allowed in fields. |
trajectories/trajectory_YYYYMMDD_HHMMSS.json | A JSON record of model calls, steps and tool use for each run (--trajectory-file sets another path) |
Environment variables (provider API keys) | An alternative to putting keys in the config file. Command-line flags beat the config file, which beats environment variables. |
- Trae Agent's example config turns on four tools: bash, str_replace_based_edit_tool, sequentialthinking and task_done. The bash tool runs commands with your user's access, and the README has no approval step or safety section.
- Isolation is optional and comes from Docker mode. In that mode the task runs in a new or existing container, and you decide which files and credentials the container can see.
- API keys sit in a git-ignored YAML file or in the environment. The trajectory files can contain prompts, command output and file contents, so keep them out of version control and shared drives.
- A search for advisories found none for trae-agent, and its GitHub advisory page lists none. Open issues in late 2026 about tool-name collisions and file truncation during edits are bug reports, not security reports.
- No CVE or security advisory for trae-agent turned up. A Mindgard write-up about the Trae IDE, a separate product, shows a project rules file steering its agent into sending local secrets out, so read rules files in repos you clone.
Security incidents and advisories
| Date | Advisory | What happened |
|---|---|---|
An open issue (#604) reports that tool names that normalize to the same string can run the wrong exact-name tool. A second issue (#601) says a JSON encoding failure can truncate a file during an agent edit. Both are reported bugs, not advisories, and no fix was seen.No fixed version published |
How to run Trae Agent safely
- Run it in Docker mode for anything you did not write, and mount only the project folder.
- Do not give the container or shell your cloud credentials, SSH keys or a full home directory.
- Start in a git branch, use --must-patch where it fits, and read the diff before you merge.
- Set --max-steps so a stuck run cannot loop for long.
- Keep trae_config.yaml and the trajectories folder out of git, since they hold keys and a full record of the run.
- Add only MCP servers you have read, because each one adds tools the model can call.
- Use a provider key with a spending cap, since the agent can loop on paid model calls.
- Check the repository's recent activity before you depend on it, because upkeep looks slow.
Where Excellent fits
| What Excellent does | With Trae Agent |
|---|---|
Reads its session logs (free scan) | Yes |
Its key finder reads its key files | Yes |
Live check before risky actions (Pro) | No |
Excellent's sandbox | Claude Code and Codex only |
Rule sharing | Claude Code and Codex only |
Excellent reads Trae Agent's session logs on your Mac. The free scan shows what it did: your email in request commands or form inputs, keys sitting in logs, secrets files read, history overwritten, checks skipped. Each finding says which agent and where.
Excellent's sandbox and rule sharing are for Claude Code and Codex only. The check reads what a command says, so it isn't a wall around your Mac.
Questions
Does Trae Agent ask before running commands?
The README documents no approval step. Its bash tool runs commands directly, so use Docker mode or a disposable machine for risky tasks.
Is Trae Agent the same as the Trae IDE?
No. Trae Agent is an MIT-licensed CLI at bytedance/trae-agent. The Trae IDE (TraeCode on trae.ai) is a separate product, and the CLI README does not mention it.
Which models does it support?
OpenAI, Anthropic, Google Gemini, OpenRouter, Doubao, Ollama and Azure. You set them in trae_config.yaml or with --provider and --model.
Where are runs recorded?
In trajectories/trajectory_YYYYMMDD_HHMMSS.json by default. Use --trajectory-file to choose a path.
Is it still maintained?
The README says development continues, but the latest commit I could view was dated February 2026 and recent issues show no maintainer replies, so treat it as lightly maintained.
Sources
Checked December 2, 2026. Trae Agent changes often, so its own docs win where they differ from this page.
