API reference¶
This page links to the primary public Python APIs currently implemented in the repository.
Core¶
satark.core.engine.AnalysisEngine ¶
AnalysisEngine(
plugins: Sequence[Plugin] | None = None,
*,
store: EventStore | None = None,
settings: SatarkSettings | None = None
)
Domain-agnostic engine for security analytics.
The engine does not understand vendor formats. Plugins normalize data into Events; the engine stores them, runs pipelines, and aggregates findings.
Source code in src/satark/core/engine.py
register ¶
Register a plugin by its metadata name.
list_plugins ¶
get_plugin ¶
Fetch a registered plugin or raise KeyError.
ingest ¶
ingest_raw ¶
ingest_raw(
plugin_name: str,
records: Sequence[dict[str, Any]],
context: PluginContext | None = None,
) -> list[Event]
Normalize raw records via a plugin and store the resulting events.
Source code in src/satark/core/engine.py
analyze ¶
analyze(
*,
plugin_name: str | None = None,
events: Sequence[Event] | None = None,
context: PluginContext | None = None
) -> AnalysisResult
Analyze events with one or all plugins.
Source code in src/satark/core/engine.py
run_plugin ¶
Run a plugin's full collect→normalize→detect→score→explain pipeline.
Source code in src/satark/core/engine.py
satark.core.plugin.Plugin ¶
Bases: ABC
Abstract base for all SATARK analytics plugins.
Prefer composition for helpers; subclasses implement the stage methods.
Detections produced by :meth:detect must be reproducible without AI.
collect ¶
Collect raw vendor/source records.
Default implementation yields nothing; override when the plugin owns its own data sources.
normalize
abstractmethod
¶
Normalize raw records into canonical :class:Event objects.
detect
abstractmethod
¶
score
abstractmethod
¶
explain ¶
explain(
detection: Detection,
score: ScoreBreakdown,
events: Sequence[Event],
context: PluginContext,
) -> str
Return a human-readable explanation for a scored detection.
Source code in src/satark/core/plugin.py
run ¶
Execute the full plugin pipeline: collect → normalize → detect → score → explain.
Source code in src/satark/core/plugin.py
satark.core.events.Event ¶
Bases: BaseModel
Canonical security event consumed by the SATARK engine.
Examples¶
from datetime import datetime, UTC Event( ... category=EventCategory.USB_INSERTION, ... source="endpoint.agent", ... actor="alice", ... timestamp=datetime.now(UTC), ... attributes={"device_id": "USB-42"}, ... ) Event(...)
with_attribute ¶
Return a copy with an additional attribute (immutability-friendly).
Scoring¶
satark.scoring.risk.aggregate_score ¶
aggregate_score(
factors: Sequence[ScoreFactor],
*,
confidence: float,
reasoning: str,
evidence: Sequence[Evidence] | None = None,
references: Sequence[KnowledgeReference] | None = None,
baseline: float = 0.0
) -> ScoreBreakdown
Aggregate signed factor contributions into an explainable score.
Positive contributions increase risk; negative contributions reduce it. The result is always clamped to [0, 1].
Source code in src/satark/scoring/risk/__init__.py
satark.scoring.explainability.why_malicious ¶
Short answer to: Why was this event classified as malicious?
Source code in src/satark/scoring/explainability/__init__.py
Plugins¶
satark.plugins.registry.create_plugin ¶
Instantiate a built-in plugin by name.
Source code in src/satark/plugins/registry.py
satark.plugins.insider.InsiderThreatPlugin ¶
Bases: Plugin
Detect insider-threat patterns from normalized endpoint events.
Source code in src/satark/plugins/insider/__init__.py
For deeper module docs, browse the source under src/satark/.