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.6 KB
Raw Blame

aisoc-sdk

License: MIT PyPI release

Async Python client SDK for AiSOC.

Status — monorepo today, not yet on PyPI. pip install aisoc-sdk does not resolve; install from 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 && pip install -e packages/sdk-py

# Not yet on PyPI — 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.
#   pip install aisoc-sdk

Quick start

import asyncio
from aisoc_sdk import AiSOCClient


async def main():
    async with AiSOCClient(
        base_url="https://your-aisoc.example.com",
        token="aisoc_...",
    ) as client:
        # List critical open alerts
        alerts = await client.alerts.list(severity="critical", status="open")
        print(f"Found {alerts.total} critical alerts")

        # Create a case
        case = await client.cases.create(
            title="Suspicious lateral movement",
            priority="high",
        )

        # Trigger a playbook
        run = await client.playbooks.run(
            "isolate-host",
            trigger_data={"host_id": "srv-prod-42", "case_id": case.id},
        )
        print("Playbook run:", run.run_id)


asyncio.run(main())

GraphQL

async with AiSOCClient(base_url="...", token="...") as client:
    result = await client.graphql("""
        query {
            alerts(pageSize: 10, status: "open") {
                items { id title severity }
            }
        }
    """)

API reference

All resource methods are async and return typed Pydantic models.

Attribute 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(page, page_size), get(id)
client.connectors list(page, page_size), get(id)
client.playbooks list(page, page_size), get(id), create(**data), update(id, **data), delete(id), run(id, trigger_data?), get_run(run_id)
client.api_keys list(), create(req), revoke(id)

Development

pip install -e ".[dev]"
pytest