Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 24 additions & 5 deletions packages/decepticon/decepticon/tools/defense/blue_cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,26 @@
from pathlib import Path
from typing import Any

from autobot.bluecell.rule_match import RuleMatcher, load_rules
from autobot.bluecell.tap import BlueCellTap

def _bluecell_sensor():
"""Resolve the AutoBot detection modules (optional dependency).

The rule engine and tap moved to the AutoBot package (migration stage
2c). Without it installed the KG scan tool fails with a clean install
hint at call time instead of breaking the tools import — Blue is
optional.
"""
try:
from autobot.bluecell import rule_match, tap
except ImportError as exc: # pragma: no cover - install-shape dependent
raise RuntimeError(
"The blue_cell scan tool requires the AutoBot package. "
"Install it with: pip install decepticon[blue] (or install "
"autobot from the BitterSecurity/AutoBot repository)"
) from exc
return rule_match, tap


from langchain_core.runnables import RunnableConfig
from langchain_core.tools import tool

Expand Down Expand Up @@ -143,9 +161,10 @@ def _scan_and_record(
) -> dict[str, Any]:
"""Replay the tap, evaluate rules, record detections, return coverage."""
rules_path = rules_path or str(_BUNDLED_RULES)
rules = load_rules(rules_path)
matcher = RuleMatcher(rules)
events = BlueCellTap(workspace_path).read_batch()
rule_match, tap = _bluecell_sensor()
rules = rule_match.load_rules(rules_path)
matcher = rule_match.RuleMatcher(rules)
events = tap.BlueCellTap(workspace_path).read_batch()

detections = 0
techniques: set[str] = set()
Expand Down
6 changes: 5 additions & 1 deletion packages/decepticon/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ telemetry = [
# pyjwt[crypto] backs the JWT (OAuth 2.1 resource-server) auth mode on the
# streamable-http transport; shared-secret + stdio modes never import it.
mcp = ["mcp>=1.30.0,<2", "pyjwt[crypto]>=2.10"]
all = ["decepticon[neo4j,telemetry,mcp]"]
# Blue observation (the AutoBot package — the defensive sibling). Installing
# this extra serves the autobot graph on the Decepticon server via the
# ``decepticon.agents`` entry-point (migration stage 2c, design doc §0.3/§0.5).
blue = ["bs-autobot>=0.1.1"]
all = ["decepticon[neo4j,telemetry,mcp,blue]"]
Comment on lines +110 to +111

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update uv.lock when adding the Blue extra

The committed uv.lock still lists only neo4j, telemetry, mcp, and all in Decepticon's provides-extras, contains no bs-autobot dependency, and retains the previous all definition. Both Python jobs in .github/workflows/ci.yml run uv sync --dev --locked (lines 214 and 320), so this metadata change requires a lockfile update even when Blue is not selected. The installed CLI describes --locked as “Assert that the uv.lock will remain unchanged”; these jobs therefore cannot accept the required re-resolution. Regenerate and commit the workspace lockfile with the extra.

Useful? React with 👍 / 👎.

Comment on lines +110 to +111

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Record the new installation behavior in the root changelog

This commit adds the user-visible decepticon[blue] installation option and changes decepticon[all] to install AutoBot, but leaves the root CHAGELOG.md unchanged. Add an Unreleased entry describing the new extra and the additional dependency for existing all consumers, with the associated PR link when available. The repository explicitly requires this change tracking before opening or updating a PR.

AGENTS.md reference: AGENTS.md:L3-L7

Useful? React with 👍 / 👎.


[project.scripts]
decepticon-cli = "decepticon.cli.__main__:main"
Expand Down
32 changes: 29 additions & 3 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading