Official TypeScript/JavaScript SDK for building secure, autonomous agents with the AEGIS runtime.
npm config set @100monkeys-ai:registry https://npm.pkg.github.com
npm install @100monkeys-ai/aegis-sdkimport { AegisClient } from "@100monkeys-ai/aegis-sdk";
async function main() {
// Option 1: OAuth2 Client Credentials (service-to-service)
const client = new AegisClient({
baseUrl: "https://your-orchestrator.example.com",
keycloakUrl: "https://auth.example.com",
realm: "aegis-system",
clientId: "your-client-id",
clientSecret: "your-client-secret",
});
// Option 2: Static bearer token (API keys, testing)
const client2 = new AegisClient({
baseUrl: "https://your-orchestrator.example.com",
bearerToken: "your-api-key-or-jwt",
});
// Start an execution
const { execution_id } = await client.startExecution(
"my-agent",
"Summarize my emails from today",
);
console.log(`Execution started: ${execution_id}`);
}
main();- Type-safe API: Full TypeScript type definitions for all endpoints
- Promise-based: Modern async/await interface
- OAuth2 Client Credentials: Automatic token acquisition and refresh via axios interceptor
- Bearer Token Auth: Static token support for API keys and testing
- Manifest validation: Runtime validation of agent configurations
- Minimal dependencies: Lightweight footprint with only essential packages
interface AegisClientOptions {
baseUrl: string;
bearerToken?: string; // Static bearer token (skips Keycloak)
keycloakUrl?: string; // Required if bearerToken not set
realm?: string; // Required if bearerToken not set
clientId?: string; // Required if bearerToken not set
clientSecret?: string; // Required if bearerToken not set
tokenRefreshBufferSecs?: number; // default: 30
}client.listAgents({ scope?, limit?, agent_type? })
client.getAgent(id)
client.deployAgent(manifest, { force?, scope? })
client.updateAgent(id, update)
client.deleteAgent(id)
client.lookupAgent(name)
client.executeAgent(agentId, input, intent?, contextOverrides?)
client.listAgentVersions(id, limit?)
client.updateAgentScope(id, scope)
client.streamAgentEvents(agentId)client.startExecution(agentId, input, contextOverrides?, intent?)
client.streamExecution(executionId, token?)
client.listExecutions({ agent_id?, workflow_name?, limit?, offset?, status? })
client.getExecution(executionId)
client.cancelExecution(executionId, reason?)
client.deleteExecution(executionId)
client.getExecutionFile(executionId, path)client.listWorkflows({ scope?, limit?, visible? })
client.getWorkflow(name)
client.getWorkflowYaml(name)
client.registerWorkflow(yaml, { scope?, force? })
client.deleteWorkflow(name)
client.listWorkflowVersions(name, limit?)
client.updateWorkflowScope(name, scope)
client.runWorkflow(name, input?, contextOverrides?)
client.executeWorkflow(workflowName, input?, version?, timeout?)client.listWorkflowExecutions({ workflow_name?, limit?, status? })
client.getWorkflowExecution(executionId)
client.deleteWorkflowExecution(executionId)
client.signalWorkflowExecution(executionId, signalName, payload?)
client.cancelWorkflowExecution(executionId, reason?)
client.getWorkflowExecutionLogs(executionId, limit?, offset?)
client.streamWorkflowExecutionLogs(executionId)client.createVolume(label, sizeLimitBytes?)
client.listVolumes(limit?)
client.getVolume(id)
client.renameVolume(id, label)
client.deleteVolume(id)
client.getQuota()
client.listFiles(volumeId, path?)
client.downloadFile(volumeId, path)
client.uploadFile(volumeId, path, file)
client.mkdir(volumeId, path)
client.movePath(volumeId, from, to)
client.deletePath(volumeId, path)client.listCredentials()
client.storeApiKeyCredential(provider, apiKeyValue, metadata?)
client.oauthInitiate(provider, redirectUri?, scopes?)
client.oauthCallback(code, state)
client.devicePoll(deviceCode, provider)
client.getCredential(id)
client.revokeCredential(id)
client.rotateCredential(id, request?)
client.listGrants(credentialId)
client.addGrant(credentialId, grant)
client.revokeGrant(credentialId, grantId)client.listSecrets(pathPrefix?)
client.getSecret(path)
client.writeSecret(path, value, encoding?)
client.deleteSecret(path)client.listApiKeys()
client.createApiKey(name, scopes, expiresAt?)
client.revokeApiKey(id)client.listMembers(limit?)
client.inviteMember(email, role)
client.removeMember(userId)
client.updateRole(userId, role)
client.getSamlConfig()
client.setSamlConfig(config)
client.getSubscription()client.getClusterStatus()
client.listClusterNodes(limit?)client.listSwarms(limit?)
client.getSwarm(swarmId)client.ingestStimulus(payload)
client.listStimuli(limit?)
client.getStimulus(stimulusId)
client.sendWebhook(source, payload)client.listSecurityIncidents(limit?)
client.listStorageViolations(limit?)
client.getDashboardSummary()client.listCortexPatterns(query?, limit?)
client.getCortexSkills(limit?)
client.getCortexMetrics(metricType?)client.getUserRateLimitUsage();client.listPendingApprovals()
client.getPendingApproval(id)
client.approveRequest(id, request?)
client.rejectRequest(id, request)client.attestSeal(payload)
client.invokeSeal(payload)
client.listSealTools(securityContext?)client.dispatchGateway(payload);client.createTenant(slug, displayName, tier?)
client.listTenants()
client.suspendTenant(slug)
client.deleteTenant(slug)client.listRateLimitOverrides(tenantId?, userId?)
client.createRateLimitOverride(payload)
client.deleteRateLimitOverride(overrideId)
client.getRateLimitUsage(scopeType, scopeId)client.healthLive();
client.healthReady();Create an agent.yaml file:
version: "1.0"
agent:
name: "my-agent"
runtime: "node:20"
memory: true
permissions:
network:
allow:
- "api.openai.com"
fs:
read: ["/data/inputs"]
write: ["/data/outputs"]
tools:
- "mcp:gmail"
env:
OPENAI_API_KEY: "secret:openai-key"See the examples repository for complete examples:
- Email Summarizer
- Web Researcher
- Code Reviewer
# Clone the repository
git clone https://github.com/100monkeys-ai/aegis-sdk-typescript
cd aegis-sdk-typescript
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Lint
npm run lintaegis-sdk-typescript/
├── src/
│ ├── client.ts # Main client
│ ├── manifest.ts # Manifest types
│ ├── types.ts # Common types
│ └── index.ts # Exports
├── dist/ # Build output
├── package.json
└── tsconfig.json
GNU Affero General Public License v3.0 - See LICENSE for details.
- aegis-orchestrator - Core runtime
- aegis-sdk-python - Python SDK
- aegis-examples - Example agents
Build secure AI agents with TypeScript.