agentic-threat-hunting-framework 0.3.0__py3-none-any.whl → 0.4.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentic-threat-hunting-framework
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: Agentic Threat Hunting Framework - Memory and AI for threat hunters
5
5
  Author-email: Sydney Marrone <athf@nebulock.io>
6
6
  Maintainer-email: Sydney Marrone <athf@nebulock.io>
@@ -33,6 +33,7 @@ Requires-Dist: click>=8.0.0
33
33
  Requires-Dist: pyyaml>=6.0
34
34
  Requires-Dist: rich>=10.0.0
35
35
  Requires-Dist: jinja2>=3.0.0
36
+ Requires-Dist: python-dotenv>=0.19.0
36
37
  Requires-Dist: importlib_resources>=5.0.0; python_version < "3.9"
37
38
  Provides-Extra: dev
38
39
  Requires-Dist: pytest>=7.0.0; extra == "dev"
@@ -49,6 +50,8 @@ Requires-Dist: mkdocs>=1.5.0; extra == "docs"
49
50
  Requires-Dist: mkdocs-material>=9.0.0; extra == "docs"
50
51
  Provides-Extra: similarity
51
52
  Requires-Dist: scikit-learn>=1.0.0; extra == "similarity"
53
+ Provides-Extra: splunk
54
+ Requires-Dist: requests>=2.25.0; extra == "splunk"
52
55
  Dynamic: license-file
53
56
 
54
57
  # Agentic Threat Hunting Framework (ATHF)
@@ -1,34 +1,41 @@
1
- agentic_threat_hunting_framework-0.3.0.dist-info/licenses/LICENSE,sha256=_KObErRfiKoolznt-DF0nJnr3U9Rdh7Z4Ba7G5qqckk,1071
1
+ agentic_threat_hunting_framework-0.4.0.dist-info/licenses/LICENSE,sha256=_KObErRfiKoolznt-DF0nJnr3U9Rdh7Z4Ba7G5qqckk,1071
2
2
  athf/__init__.py,sha256=OrjZe8P97_BTEkscapnwSsqKSjwXNP9d8-HtGr19Ni0,241
3
- athf/__version__.py,sha256=1uOy8XMZ6490EmE359rotOAMj4-r0qm1IZG5gSmm_7g,59
4
- athf/cli.py,sha256=rkg_Nx9Yy_UqTXBOh-pwaiD-lXO0_IXQMA1SQpDj7g0,4639
5
- athf/commands/__init__.py,sha256=KbpUcLPjmltq5a_m1MjhrIe4sk3DvqsnAw1wCAZfZNo,85
6
- athf/commands/agent.py,sha256=k-NWiLppt2oWbiJ-hx1inkK51jhfsAYiFhixbzzQmQI,16565
3
+ athf/__version__.py,sha256=wCIQoU9b7qKcSNQiIOgHaD2buzBC-dlQYtvg8X5WS4A,59
4
+ athf/cli.py,sha256=l8PkZCs4ToUOAxX_Ciy5bLD1mV1Qta3_WalBJOA1t9c,4787
5
+ athf/agents/__init__.py,sha256=iaSJpvnXm9rz4QS7gBrsaLEjm49uvsMs4BLPOJeyp78,346
6
+ athf/agents/base.py,sha256=HQJpQAKmY7folbzPnvF2OZ9vhEf205lBFUHrtfOXr64,4352
7
+ athf/agents/llm/__init__.py,sha256=qSGA-NaInjsDkMpGQwnTz3S1OgCVlzetpMcDS_to1co,671
8
+ athf/agents/llm/hunt_researcher.py,sha256=dIyD2Izh3zdf62kCHug1DwXFgmWhOMQUTim7qM3UAIs,27071
9
+ athf/agents/llm/hypothesis_generator.py,sha256=XkbJz8IS4zwQjEy-ZD0zy2XW5uRnAy87Lii-5XTY0WU,8564
10
+ athf/commands/__init__.py,sha256=YYPIbajQf7DN_h8PFNfktgny4oHKKWKGbAU6tItE5vE,500
11
+ athf/commands/agent.py,sha256=c7ZeZa3OArXyXTgVjmUB2JXa3m9IpLFJ_FEVDhaDLE8,19000
7
12
  athf/commands/context.py,sha256=V-at81-OgKcLY-In48-AccTnHfTgdofmnjE8S5kypoI,12678
8
13
  athf/commands/env.py,sha256=JPKRsv48cgsIAjSFaGJ1-Nu0nQKGSVg4AbiFxb9jVX4,11887
9
- athf/commands/hunt.py,sha256=PcYz0Zj9qqB10s9mkbfHk-hl2IbcfJekeB6cA2exXPo,22991
14
+ athf/commands/hunt.py,sha256=aQdgNddqy_VrxZOkxhuPxIr4KLZtX5a2ZLb9079vLlw,25169
10
15
  athf/commands/init.py,sha256=Qn0iETNyuQvM-ySqCeoDz-pPemeuzROX_karQF5yN_o,12685
11
16
  athf/commands/investigate.py,sha256=mK_id5vjfN_ukqB_-fyia0FNa0pBmtn0Xv6CKHQI1Qo,24663
12
17
  athf/commands/research.py,sha256=FrLph4agaGQ_rIxMh0OQwh1MIGDFtj40zJ3E1ZFwaAw,18112
13
- athf/commands/similar.py,sha256=FTTVr4zzP9bdJrirscp6pOxdQbE8zot6pa20-_TYiuo,11804
18
+ athf/commands/similar.py,sha256=qy1Gng73_VpqfoLLNUdxF1GBx-X29g-k8Q_wrEx26hA,11868
19
+ athf/commands/splunk.py,sha256=7n7Jl1ExqZCNxUhG0kAKgAvZMqbIoGSgx2Moq7vAu-Y,11622
14
20
  athf/core/__init__.py,sha256=yG7C8ljx3UW4QZoYvDjUxsWHlbS8M-GLGB7Je7rRfqo,31
15
21
  athf/core/attack_matrix.py,sha256=QZKKmxckQ6-U7lqVdGUJoj2jEAhP3Juvr3sqaNx2oTw,3238
16
22
  athf/core/hunt_manager.py,sha256=PFsg8Ecg94NCpuFZpApo82lyORkgK5IfOIih-7-XsmM,11580
17
23
  athf/core/hunt_parser.py,sha256=FUj0yyBIcZnaS9aItMImeBDhegQwpkewIwUMNXW_ZWU,5122
18
24
  athf/core/investigation_parser.py,sha256=wbfjnq4gFgIc0a4bHIAnidVNPhbHDpIXWY1SGLk0Xls,6804
19
25
  athf/core/research_manager.py,sha256=i4fUjuZJcAik8I4pwbLkQlu6cuxkWDlqaIRQrzAfB0s,14512
20
- athf/core/template_engine.py,sha256=vNTVhlxIXZpxU7VmQyrqCSt6ORS0IVjAV54TOmUDMTE,5636
21
- athf/core/web_search.py,sha256=B9IhmwH7gy2RVA6WSN3L7yGp3Q4L8OsiiwcEvnnZejU,10320
26
+ athf/core/splunk_client.py,sha256=Xib2zVwV2l8eChzqUahI3PZ7Z2XS2wz01sPbF1E0Q18,11611
27
+ athf/core/template_engine.py,sha256=Awp0n9E5Q1dYA35XDKKAd5VJLdpaDl2N967hackUVa8,6010
28
+ athf/core/web_search.py,sha256=lBdApqIemV2kH_NJ3vDd3adH9DwrPjaq_fs5qMjR8mI,10354
22
29
  athf/data/__init__.py,sha256=QtgONloCaS3E9Ow995FMxyy6BbszpfmYeWpySQ2b9Mc,502
23
- athf/data/docs/CHANGELOG.md,sha256=1dAondeKsQnGOn9esy9oZ29uG_oGgRuHxmkcmGQ1Cwo,5950
24
- athf/data/docs/CLI_REFERENCE.md,sha256=zqUp-tu8OAcqzpOwx3XvzEq7UV6woDraUOcWasZI0a8,43748
30
+ athf/data/docs/CHANGELOG.md,sha256=JKkzzs1n5jSERHFi6fDt6sYEe52MSaY127dfzthkUA8,8655
31
+ athf/data/docs/CLI_REFERENCE.md,sha256=pb76UqkY_WHJMBEXwEmK0TJR8kcGzoBPlJ0WdGMKDQM,54875
25
32
  athf/data/docs/INSTALL.md,sha256=JOWxk6q2-rdpgCnWdSPb3-Cp8rX1y4nQm7ObKz2G0uM,13117
26
33
  athf/data/docs/README.md,sha256=rp-XQZeqteXJz7M2qKX3sl6o0AVfhGmz8GcNNKAt8pM,1061
27
34
  athf/data/docs/environment.md,sha256=K88NBWZM2bI1Jztd0ORa6AYaMgPVjVB-K2fJl8S5-g8,8306
28
- athf/data/docs/getting-started.md,sha256=j4SAXe-Rm1RhYBDvWaNpV8XS0rc_mZ2Ew0yPCxE4_wQ,14156
29
- athf/data/docs/level4-agentic-workflows.md,sha256=DX54qu8LbJysjDfQLGSEPSO_Q6BUACLpa-XCsR6xUp4,13439
35
+ athf/data/docs/getting-started.md,sha256=dUCpXHzucRLfUYzDylvnCtdqv9VCukfQCtGg7hTGmrI,15316
36
+ athf/data/docs/level4-agentic-workflows.md,sha256=68crKsDaLyrgxVG37nPIuJyO9NobLi09Obv7D1AnpYs,14123
30
37
  athf/data/docs/lock-pattern.md,sha256=eICjNh5SAgIhkOYBDhHg1tgw4A29xgnRDWC9vH1wLEQ,4863
31
- athf/data/docs/maturity-model.md,sha256=S2m8JSQDe9R5ROBWS4Gy0-sRF5I7mo-CI3cUnmNpxmk,16347
38
+ athf/data/docs/maturity-model.md,sha256=O1FDIKPkO9twNdZmA0w-TUwPvLP331tul2fPpUnCXD4,18181
32
39
  athf/data/docs/why-athf.md,sha256=rIoUb7iqdZKbuWNyRlGxhZrRkLx7gWAGS-kurEZDt04,2148
33
40
  athf/data/hunts/FORMAT_GUIDELINES.md,sha256=lMyBekmOzhtO1olO1P-M0Gi_n5oY60k7qkRZE63sTgw,15010
34
41
  athf/data/hunts/H-0001.md,sha256=rdUIpQ_uN8bx7XS1ED85rW5aRKxFOpMg0X7PANY7eCY,23220
@@ -44,8 +51,8 @@ athf/data/prompts/ai-workflow.md,sha256=rZtOcGuAEi35qx7182TwHJEORdz1-RxkZMBVkg61
44
51
  athf/data/prompts/basic-prompts.md,sha256=2bunpO35RoBdJWYthXVi40RNl2UWrfwOaFthBLHF5sU,8463
45
52
  athf/data/templates/HUNT_LOCK.md,sha256=zXxHaKMWbRDLewLTegYJMbXRM72s9gFFvjdwFfGNeJE,7386
46
53
  athf/utils/__init__.py,sha256=aEAPI1xnAsowOtc036cCb9ZOek5nrrfevu8PElhbNgk,30
47
- agentic_threat_hunting_framework-0.3.0.dist-info/METADATA,sha256=TT9rzSs2CSKI3TTKMkSP7ZRehUXtntbgYCWfCFK7qbU,15838
48
- agentic_threat_hunting_framework-0.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
49
- agentic_threat_hunting_framework-0.3.0.dist-info/entry_points.txt,sha256=GopR2iTiBs-yNMWiUZ2DaFIFglXxWJx1XPjTa3ePtfE,39
50
- agentic_threat_hunting_framework-0.3.0.dist-info/top_level.txt,sha256=Cxxg6SMLfawDJWBITsciRzq27XV8fiaAor23o9Byoes,5
51
- agentic_threat_hunting_framework-0.3.0.dist-info/RECORD,,
54
+ agentic_threat_hunting_framework-0.4.0.dist-info/METADATA,sha256=KpwdeeDnNEGhS6zlI3NHdcKGwaN2iGYYJDIQkRr6D9E,15949
55
+ agentic_threat_hunting_framework-0.4.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
56
+ agentic_threat_hunting_framework-0.4.0.dist-info/entry_points.txt,sha256=GopR2iTiBs-yNMWiUZ2DaFIFglXxWJx1XPjTa3ePtfE,39
57
+ agentic_threat_hunting_framework-0.4.0.dist-info/top_level.txt,sha256=Cxxg6SMLfawDJWBITsciRzq27XV8fiaAor23o9Byoes,5
58
+ agentic_threat_hunting_framework-0.4.0.dist-info/RECORD,,
athf/__version__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """Version information for ATHF."""
2
2
 
3
- __version__ = "0.3.0"
3
+ __version__ = "0.4.0"
@@ -0,0 +1,14 @@
1
+ """ATHF Agent Framework.
2
+
3
+ This module provides base classes and implementations for ATHF agents.
4
+ Agents can be deterministic (Python-only) or LLM-powered (using Claude API).
5
+ """
6
+
7
+ from athf.agents.base import Agent, AgentResult, DeterministicAgent, LLMAgent
8
+
9
+ __all__ = [
10
+ "Agent",
11
+ "AgentResult",
12
+ "DeterministicAgent",
13
+ "LLMAgent",
14
+ ]
athf/agents/base.py ADDED
@@ -0,0 +1,141 @@
1
+ """Base classes for hunt-vault agents."""
2
+
3
+ import os
4
+ from abc import ABC, abstractmethod
5
+ from dataclasses import dataclass, field
6
+ from typing import Any, Dict, Generic, List, Optional, TypeVar
7
+
8
+ # Type variables for input/output
9
+ InputT = TypeVar("InputT")
10
+ OutputT = TypeVar("OutputT")
11
+
12
+
13
+ @dataclass
14
+ class AgentResult(Generic[OutputT]):
15
+ """Standard result format for all agents."""
16
+
17
+ success: bool
18
+ data: Optional[OutputT]
19
+ error: Optional[str] = None
20
+ warnings: List[str] = field(default_factory=list)
21
+ metadata: Dict[str, Any] = field(default_factory=dict)
22
+
23
+ @property
24
+ def is_success(self) -> bool:
25
+ """Check if the agent execution was successful."""
26
+ return self.success and self.error is None
27
+
28
+
29
+ class Agent(ABC, Generic[InputT, OutputT]):
30
+ """Base class for all agents."""
31
+
32
+ def __init__(self, config: Optional[Dict[str, Any]] = None):
33
+ """Initialize agent with optional configuration.
34
+
35
+ Args:
36
+ config: Optional configuration dictionary
37
+ """
38
+ self.config = config or {}
39
+ self._setup()
40
+
41
+ def _setup(self) -> None:
42
+ """Optional setup method for subclasses."""
43
+ pass
44
+
45
+ @abstractmethod
46
+ def execute(self, input_data: InputT) -> AgentResult[OutputT]:
47
+ """Execute agent logic.
48
+
49
+ Args:
50
+ input_data: Input for the agent
51
+
52
+ Returns:
53
+ AgentResult with output data or error
54
+ """
55
+ pass
56
+
57
+ def __call__(self, input_data: InputT) -> AgentResult[OutputT]:
58
+ """Allow calling agent as a function."""
59
+ return self.execute(input_data)
60
+
61
+
62
+ class DeterministicAgent(Agent[InputT, OutputT]):
63
+ """Base class for deterministic Python agents (no LLM)."""
64
+
65
+ pass
66
+
67
+
68
+ class LLMAgent(Agent[InputT, OutputT]):
69
+ """Base class for LLM-powered agents."""
70
+
71
+ def __init__(self, config: Optional[Dict[str, Any]] = None, llm_enabled: bool = True):
72
+ """Initialize LLM agent.
73
+
74
+ Args:
75
+ config: Optional configuration dictionary
76
+ llm_enabled: Whether to enable LLM functionality
77
+ """
78
+ self.llm_enabled = llm_enabled
79
+ super().__init__(config)
80
+
81
+ def _log_llm_metrics(
82
+ self,
83
+ agent_name: str,
84
+ model_id: str,
85
+ input_tokens: int,
86
+ output_tokens: int,
87
+ cost_usd: float,
88
+ duration_ms: int,
89
+ ) -> None:
90
+ """Log LLM call metrics to centralized tracker.
91
+
92
+ Args:
93
+ agent_name: Name of the agent (e.g., "hypothesis-generator")
94
+ model_id: Bedrock model ID
95
+ input_tokens: Number of input tokens
96
+ output_tokens: Number of output tokens
97
+ cost_usd: Estimated cost in USD
98
+ duration_ms: Call duration in milliseconds
99
+ """
100
+ try:
101
+ from athf.core.metrics_tracker import MetricsTracker # type: ignore[import-not-found]
102
+
103
+ MetricsTracker.get_instance().log_bedrock_call(
104
+ agent=agent_name,
105
+ model_id=model_id,
106
+ input_tokens=input_tokens,
107
+ output_tokens=output_tokens,
108
+ cost_usd=cost_usd,
109
+ duration_ms=duration_ms,
110
+ )
111
+ except Exception:
112
+ pass # Never fail agent execution due to metrics logging
113
+
114
+ def _get_llm_client(self) -> Any:
115
+ """Get AWS Bedrock runtime client for Claude models.
116
+
117
+ Returns:
118
+ Bedrock runtime client instance or None if LLM is disabled
119
+
120
+ Raises:
121
+ ValueError: If AWS credentials are not configured
122
+ ImportError: If boto3 package is not installed
123
+ """
124
+ if not self.llm_enabled:
125
+ return None
126
+
127
+ try:
128
+ import boto3 # type: ignore[import-untyped]
129
+
130
+ # Get AWS region from environment or use default
131
+ region = os.getenv("AWS_REGION", os.getenv("AWS_DEFAULT_REGION", "us-east-1"))
132
+
133
+ # Create Bedrock runtime client
134
+ # Uses AWS credentials from environment, ~/.aws/credentials, or IAM role
135
+ client = boto3.client(service_name="bedrock-runtime", region_name=region)
136
+
137
+ return client
138
+ except ImportError:
139
+ raise ImportError("boto3 package not installed. Run: pip install boto3")
140
+ except Exception as e:
141
+ raise ValueError(f"Failed to create Bedrock client: {e}")
@@ -0,0 +1,27 @@
1
+ """LLM-powered agents for ATHF.
2
+
3
+ These agents use Claude API for creative and analytical tasks.
4
+ All LLM agents have fallback to deterministic methods when LLM is disabled.
5
+ """
6
+
7
+ from athf.agents.llm.hunt_researcher import (
8
+ HuntResearcherAgent,
9
+ ResearchInput,
10
+ ResearchOutput,
11
+ ResearchSkillOutput,
12
+ )
13
+ from athf.agents.llm.hypothesis_generator import (
14
+ HypothesisGenerationInput,
15
+ HypothesisGenerationOutput,
16
+ HypothesisGeneratorAgent,
17
+ )
18
+
19
+ __all__ = [
20
+ "HypothesisGeneratorAgent",
21
+ "HypothesisGenerationInput",
22
+ "HypothesisGenerationOutput",
23
+ "HuntResearcherAgent",
24
+ "ResearchInput",
25
+ "ResearchOutput",
26
+ "ResearchSkillOutput",
27
+ ]