Skip to content

armgit / AiSOC

Public Imported from GitHub
0

Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.

2.5 KB
Raw Blame

@aisoc/sdk

License: MIT npm release

TypeScript client SDK for AiSOC — auto-generated types from docs/openapi.yaml, hand-crafted ergonomic API.

Status — monorepo today, not yet on npm. npm install @aisoc/sdk does not resolve; use the monorepo source path below. The import path (@aisoc/sdk) and API surface stay identical once it ships.

Installation

# Today (from this monorepo):
git clone https://github.com/beenuar/AiSOC.git
cd AiSOC && pnpm --filter @aisoc/sdk install

# Not yet on npm — the upload is blocked on registry credentials,
# which is an account action rather than a code change. Until then, install
# from source with the command above.
#   npm install @aisoc/sdk
#   pnpm add @aisoc/sdk

Quick start

import { AiSOCClient } from "@aisoc/sdk";

const client = new AiSOCClient({
  baseUrl: "https://your-aisoc.example.com",
  token: process.env.AISOC_API_TOKEN!, // JWT or aisoc_… API key
});

// List critical open alerts
const alerts = await client.alerts.list({
  severity: "critical",
  status: "open",
  pageSize: 50,
});
console.log(`Found ${alerts.total} critical alerts`);

// Create a case
const newCase = await client.cases.create({
  title: "Suspicious lateral movement",
  priority: "high",
});

// Trigger a playbook
const run = await client.playbooks.run("isolate-host", {
  hostId: "srv-prod-42",
  caseId: newCase.id,
});
console.log("Playbook run:", run.runId);

GraphQL

const result = await client.graphql<{ alerts: { items: unknown[] } }>(`
  query {
    alerts(pageSize: 10, status: "open") {
      items { id title severity }
    }
  }
`);

API reference

All resource sub-clients live on the AiSOCClient instance:

Namespace Methods
client.alerts list(filters?), get(id), update(id, data)
client.cases list(filters?), get(id), create(data), update(id, data), delete(id)
client.detections list(params?), get(id)
client.connectors list(params?), get(id)
client.playbooks list(params?), get(id), create(data), update(id, data), delete(id), run(id, triggerData?), getRun(runId)
client.apiKeys list(), create(data), revoke(id)

Development

# Regenerate types from the OpenAPI schema
pnpm codegen

# Build
pnpm build

# Run tests
pnpm test