ACPpotamia

Advanced guide / Chapter 6 of 7

Testing and CI with test keys.

Running agent tests against real models is slow and flaky, and you pay for every run. A test key goes through every ACPpotamia check for real, then answers with a mock in the provider's exact format, streamed or not. As far as your code can tell it talked to OpenAI or Anthropic. The bill stays at $0.

Test keys run every check, then answer with a mock instead of calling a providerCI or dev agentacp_test_ keyno provider keyEvery real checkmodel policy, kill switch,rate limits, loop detection,budgets, audit logMock responseexact provider formatstreamed or not, $0Providernever calledYour codeparses it likea real answer
A test key passes through every check, but the provider is never called.

Set up

  1. Console → API keys → Create key → tick Test key. It starts with acp_test_.
  2. Use it exactly like a real key. No provider key is needed.
  3. Steer the mock per call with headers:
HeaderEffect
X-ControlPlane-Mock-Content: Order 42 is shipped.The reply text.
X-ControlPlane-Mock-Status: 429A provider-format rate-limit error, with Retry-After.
X-ControlPlane-Mock-Status: 500 or 529A provider-format server or overloaded error.

In a CI pipeline

GitHub Actions

# .github/workflows/agents.yml
name: agent tests
on: [push]
jobs:
  test:
    runs-on: ubuntu-latest
    env:
      OPENAI_BASE_URL: https://acp.examopotamia.com/v1
      ACP_KEY: ${{ secrets.ACP_TEST_KEY }}     # an acp_test_ key
    steps:
      - uses: actions/checkout@v4
      - run: npm ci && npm test

What to test with it

BehaviourHow
Your retry logicSend X-ControlPlane-Mock-Status: 429 and check your code waits and retries.
Budget handlingSet the test key's budget to $0 on the API keys page; your code should handle the 402.
Loop handlingRepeat the same call in one session; the 5th gets 429 loop_detected.
Model policyCall a model outside the policy; expect 403 model_not_allowed.
Streaming parsersRequest stream: true; the mock streams in the provider's real event format.
Tip. Test calls show up in Activity with a Test label. They cost $0 and don't touch your team's budget or token count.