vantageai
v0.4.1
Published
Vantage TypeScript SDK — vendor-neutral AI agent audit platform
Readme
vantageai
TypeScript SDK for Vantage governance, execution-boundary enforcement, and brokered model execution.
Install
pnpm add vantageaiCore Client
import { VantageClient } from 'vantageai';
const vantage = new VantageClient({
apiKey: 'vt-...',
agentId: 'mortgage-underwriter',
baseUrl: 'https://api.vantage.ai',
});Observed Telemetry
await vantage.logEvent({
type: 'llm_call',
vendor: 'openai',
input: { model: 'gpt-4.1-mini' },
output: { content: 'approved' },
metadata: { guaranteeTier: 'observed' },
});Evaluate, Authorize, Commit
const decision = await vantage.evaluate({
actionType: 'approve_large_loan',
actionPayload: { amount: 850000, applicantId: 'app-123' },
});
const authorization = await vantage.authorize({
actionType: 'openai.chat.completions.create',
actionPayload: {
model: 'gpt-4.1-mini',
messages: [{ role: 'user', content: 'Summarize the file' }],
},
executionTraceId: 'trace-123',
ttlSeconds: 120,
});
if (authorization.decision === 'allow' && authorization.authorization) {
await vantage.commitAuthorization(authorization.authorization.id, {
actionPayload: {
model: 'gpt-4.1-mini',
messages: [{ role: 'user', content: 'Summarize the file' }],
},
executionTraceId: 'trace-123',
});
}Brokered Provider Execution
const result = await vantage.brokerOpenAIChatCompletion({
executionTraceId: 'trace-123',
ttlSeconds: 180,
request: {
model: 'gpt-4.1-mini',
messages: [{ role: 'user', content: 'Review this mortgage application' }],
stream: false,
},
});
if (result.decision === 'allow') {
console.log(result.authorizationId, result.commitAttemptId, result.completion);
}Broker helpers are also available for client-style integrations:
import { createBrokeredOpenAIClient } from 'vantageai';
const openai = createBrokeredOpenAIClient(vantage, {
executionTraceId: 'trace-123',
ttlSeconds: 180,
});
await openai.chat.completions.create({
model: 'gpt-4.1-mini',
messages: [{ role: 'user', content: 'Review this mortgage application' }],
});Operator Visibility
const boundary = await vantage.getExecutionBoundarySettings();
const authorizations = await vantage.listExecutionAuthorizations({ limit: 20 });
const attempts = await vantage.listExecutionCommitAttempts({ limit: 20 });
const performance = await vantage.getPerformanceSnapshot();Existing Integrations
wrapOpenAIwrapAnthropicClientwrapGroqClientwrapOpenRouterClientwrapGeminiClientVantageCallbackHandlerfor LangChain
Observed wrappers keep post-execution logging behavior. Brokered helpers are the authoritative path when you want Vantage to mediate the side effect.
