Skip to content

eaos-workspace API Reference

Executes an agentic operation under explicit policy gatekeeper approval and sandbox constraints.

function approvedExecution<T>(action: () => Promise<T>, options?: ExecutionOptions): Promise<T>
Parameter Type Required Description
action () => Promise<T> Yes The asynchronous task or effect to be executed.
options ExecutionOptions Optional Execution constraints including timeout, circuit breaker thresholds, and audit sinks.
  • Type: Promise<T>
  • Description: The resolved value of the executed action.
import { approvedExecution } from '@alneas/eaos-core';
const result = await approvedExecution(async () => {
return await runAgentAction();
}, { timeoutMs: 5000 });

Provides automated fault tolerance and circuit tripping when upstream LLM or external services encounter consecutive errors.

class CircuitBreaker {
constructor(config: CircuitBreakerConfig);
execute<T>(fn: () => Promise<T>): Promise<T>;
}
const breaker = new CircuitBreaker({ failureThreshold: 3, resetTimeoutMs: 10000 });
await breaker.execute(() => callLlmGateway());