Developer & SDK integration
TypeScript patterns for evaluateAction
Typed clients, result narrowing, shared handlers, and test fixtures for maintainable Auctra evaluateAction integration in TypeScript production agents.
June 4, 2026 · 6 min read · Markdown version
Typed client setup
Use @auctra/sdk exported types for action payloads and decision statuses. Centralize client creation in one module with API key from secrets manager.
Narrow results on decision: allowed, blocked, and require_approval. TypeScript exhaustiveness checks catch unhandled paths at compile time.
Shared handler
Implement evaluateAndExecute(action, executeFn) so allowed actions execute, blocked actions stop, and require_approval actions return control to your workflow. Reuse it across REST routes, LangChain tools, and background jobs.
Catch AuctraApiError for structured API failures and log action_request_id from successful evaluations for support correlation.
Fixtures and mocks
Mock Auctra client in unit tests; use staging integration tests for real evaluateAction. Keep JSON fixtures in repo for each action type boundary.
Snapshot block messages to ensure user-facing copy stays stable. Run fixtures on every PR touching tool handlers.
Versioning
Pin SDK versions and read release notes for action schema changes. Coordinate SDK upgrades with policy template updates.
Auctra ties sponsors, expiring delegations, and pre-action evaluation into one accountability chain your security and finance teams can audit.
Key takeaways
- Authority is enforced before side effects — use API keys and evaluateAction together.
- Every production agent needs a named sponsor and bounded delegation visible in the console.
- Blocked and approval-required outcomes are evidence, not failures — review them in API keys.
Implementation checklist
- Sign up at console.auctra.tech and open API keys (/console/api-keys).
- Register one agent with a named human sponsor accountable for its actions.
- Create a narrow delegation aligned with this article's workflow (TypeScript patterns for evaluateAction).
- Call evaluateAction from your agent or SDK before the consequential tool executes.
- Confirm sponsor, delegator, decision, and outcome appear in Audit or API keys.
People also ask
- Is there a TypeScript SDK for Auctra?
- Yes. @auctra/sdk provides typed evaluateAction and delegation management APIs.
- How should I structure evaluateAction in TypeScript?
- Use a shared handler with discriminated union on decision status, idempotency keys, and centralized client configuration.
- How does Auctra help with agent authority?
- Auctra registers sponsors, issues expiring delegations, evaluates actions before execution, and preserves auditable accountability records.
Try in Auctra Console
Maps to: API keys
Pilot sdk typescript in Auctra Console
Use API keys to apply this guide — register an agent, delegate authority, evaluate one real action, and inspect the audit trail. Free on Builder.
- Create a free account: https://console.auctra.tech/auth/signup?utm_source=blog&utm_medium=cta&utm_campaign=evaluate-action-typescript-patterns
- In API keys (https://console.auctra.tech/console/api-keys), undefined for one production workflow.
- Install @auctra/sdk (npm install @auctra/sdk), create an API key in API keys, and wrap your integration's tool calls with evaluateAction.
- Integrate evaluateAction (SDK or REST) before money, data, or infrastructure changes execute.
- Open Audit to verify sponsor, delegator, reviewer, and decision are recorded.
Part of guide
Developer & SDK integration
evaluateAction patterns, LangChain and MCP integration, idempotency, and shipping authority checks before production traffic.
Browse full guide →Related guides
Make authority executable.
Evaluate agent actions against bounded, expiring delegation before they reach the real world. Start free on Builder — upgrade when audit retention and accountability matter.
Auctra