Skip to main content
A test has one JSON format for reading and writing. Get Test returns it, and Create Test accepts the same body as is. That makes it easy to keep tests in version control, copy them to another agent, or move them to another team. Prerequisites
  • A Fish Audio API key for each team involved.
  • bash, curl, and jq 1.6 or later for the scripts below.

The export format

An exported test contains every field of its test type, plus: Tools appear as {"id", "name", "type"} wherever a test references them: referenced_tool, simulation.assertions, simulation.tool_mocks.tools, and simulation.tool_mocks.real_tools. Webhook and client tool ids belong to your team. Integration tool ids, such as google_calendar:create_event, are the same in every team. Every call to Create Test creates a new test, so importing the same file twice gives you two copies.

Export tests to files

This script saves every test attached to an agent as tests/<test_id>.json. Drop the agent_id parameter to export your whole test library instead.
export-tests.sh

Import into the same team

Within one team, tool ids stay valid, so the files import as they are:
import-tests.sh
Each test is attached to the agents in its agent_ids. To attach the copies to a different agent instead, rewrite that field on the way in:
All agents in agent_ids must be in the same workspace, and the test is created there.

Import into another team

Webhook and client tool ids from the source team mean nothing in the target team, so each reference has to point at the target team’s tool of the same name first.
Create Test does not reject webhook and client tool ids it doesn’t know. A test imported without remapping saves fine but misbehaves when it runs: its mocks never apply, required tool calls fail with This tool is not on the agent, and forbidden tool checks pass without checking anything. Always remap before importing into another team.
1

Recreate the tools

In the target team, create the tools the tests reference, with the same names, for example with Create Tool, and attach them to the target agent. Connect the same integrations on that agent if the tests reference integration tools.
2

Remap and import

Run this script with the target team’s API key and agent. It reads the tools the target agent offers from List Test Tools, replaces every webhook and client tool id by name, attaches each test to the target agent, and stops with the tool’s name if the agent has no tool with that name.
import-into-team.sh
Integration tool ids are left as they are, since they are the same in every team.

Going further

Agent tests

Every test type and how its fields map to the API.

Run tests from CI

Run an agent’s tests from your pipeline and gate on the result.