Local Testing with Tunnel
Start the Dev Server with Tunnel
Run the dev server with the On the first run, this downloads the Cloudflare tunnel binary (~30MB). After setup, you’ll see output like:
--tunnel flag:Add the Webhook URL in the Platform
- Open your app in the AgentMark dashboard
- Navigate to Settings
- Paste the tunnel URL into the Webhook URL field
- Paste the secret into the Webhook Secret field
- Save
Run a Prompt from the Platform
- Open a prompt in the platform editor
- Click Run
- The platform sends the prompt event to your tunnel URL
- Your local dev server executes the prompt using your adapter and models
- The result streams back to the platform
http://localhost:3000.How It Works
When you runagentmark dev --tunnel, three services start:
| Service | Port | Purpose |
|---|---|---|
| API server | 9418 | Serves prompts, collects traces |
| Webhook server | 9417 | Receives and executes prompt/dataset events |
| Dashboard | 3000 | View traces, sessions, and requests |
dev-entry.ts.
When the tunnel is active, all incoming requests are verified using the x-agentmark-signature-256 header and your webhook secret. In local-only mode (without --tunnel), signature verification is skipped for convenience.
Webhook Handlers
Each adapter provides a webhook handler via its/runner export. This is configured automatically in your dev-entry.ts:
- AI SDK (Vercel)
- Claude Agent SDK
- Mastra
dev-entry.ts
The
dev-entry.ts file is generated by npm create agentmark@latest and is version-controlled. You can customize it to add additional setup logic.Supported Events
The webhook server handles these event types from the platform:| Event | Description |
|---|---|
prompt-run | Execute a single prompt from the platform editor |
dataset-run | Run a prompt against a dataset for experiments |
Troubleshooting
| Issue | Solution |
|---|---|
| Tunnel fails to start | Check internet connection. Set AGENTMARK_SKIP_CLOUDFLARED_DOWNLOAD=true to skip if behind a proxy and install cloudflared manually |
| Platform can’t reach webhook | Ensure the tunnel URL in Settings matches the one printed in your terminal |
| Signature verification fails | The secret in the platform must match the one from agentmark dev --tunnel output |
| Prompts not found | Make sure the dev server is running and your agentmark/ directory contains the prompt files |
Production Webhooks
For production deployments, you’ll need a publicly accessible webhook endpoint. See the full webhook documentation:Have Questions?
We’re here to help! Choose the best way to reach us:
- Join our Discord community for quick answers and discussions
- Email us at hello@agentmark.co for support
- Schedule an Enterprise Demo to learn about our business solutions