fableforge-agent 0.1.0__tar.gz
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.
- fableforge_agent-0.1.0/PKG-INFO +109 -0
- fableforge_agent-0.1.0/README.md +90 -0
- fableforge_agent-0.1.0/pyproject.toml +36 -0
- fableforge_agent-0.1.0/setup.cfg +4 -0
- fableforge_agent-0.1.0/src/fableforge_agent/__init__.py +63 -0
- fableforge_agent-0.1.0/src/fableforge_agent/cli.py +184 -0
- fableforge_agent-0.1.0/src/fableforge_agent/control_plane/__init__.py +37 -0
- fableforge_agent-0.1.0/src/fableforge_agent/control_plane/auth.py +152 -0
- fableforge_agent-0.1.0/src/fableforge_agent/control_plane/core.py +303 -0
- fableforge_agent-0.1.0/src/fableforge_agent/observability/__init__.py +29 -0
- fableforge_agent-0.1.0/src/fableforge_agent/observability/core.py +229 -0
- fableforge_agent-0.1.0/src/fableforge_agent/trust/__init__.py +27 -0
- fableforge_agent-0.1.0/src/fableforge_agent/trust/core.py +190 -0
- fableforge_agent-0.1.0/src/fableforge_agent.egg-info/PKG-INFO +109 -0
- fableforge_agent-0.1.0/src/fableforge_agent.egg-info/SOURCES.txt +17 -0
- fableforge_agent-0.1.0/src/fableforge_agent.egg-info/dependency_links.txt +1 -0
- fableforge_agent-0.1.0/src/fableforge_agent.egg-info/entry_points.txt +2 -0
- fableforge_agent-0.1.0/src/fableforge_agent.egg-info/requires.txt +8 -0
- fableforge_agent-0.1.0/src/fableforge_agent.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fableforge-agent
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Self-improving AI agent framework with behavioral observability and trust protocols
|
|
5
|
+
Author-email: KingLabsA <kinglabsa@users.noreply.github.com>
|
|
6
|
+
License: Apache 2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/KingLabsA/llm-training-platform
|
|
8
|
+
Project-URL: Source, https://github.com/KingLabsA/llm-training-platform
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
Requires-Dist: hermes-agent>=0.18.0
|
|
12
|
+
Requires-Dist: torch>=2.0.0
|
|
13
|
+
Requires-Dist: rich>=13.0.0
|
|
14
|
+
Requires-Dist: fastapi>=0.100.0
|
|
15
|
+
Requires-Dist: uvicorn>=0.23.0
|
|
16
|
+
Requires-Dist: pydantic>=2.0.0
|
|
17
|
+
Requires-Dist: cryptography>=41.0.0
|
|
18
|
+
Requires-Dist: httpx>=0.24.0
|
|
19
|
+
|
|
20
|
+
╔═══════════════════════════════════════════════════════════════╗
|
|
21
|
+
║ ███████╗ █████╗ ██████╗ ██╗ ███████╗ ║
|
|
22
|
+
║ ██╔════╝██╔══██╗██╔══██╗██║ ██╔════╝ ║
|
|
23
|
+
║ █████╗ ███████║██████╔╝██║ █████╗ ║
|
|
24
|
+
║ ██╔══╝ ██╔══██║██╔══██╗██║ ██╔══╝ ║
|
|
25
|
+
║ ██║ ██║ ██║██████╔╝███████╗███████╗ ║
|
|
26
|
+
║ ╚═╝ ╚═╝ ╚═╝╚═════╝ ╚══════╝╚══════╝ ║
|
|
27
|
+
║ ███████╗ ██████╗ ██████╗ ██████╗ ███████╗ ║
|
|
28
|
+
║ ██╔════╝██╔════╝ ██╔══██╗██╔════╝ ██╔════╝ ║
|
|
29
|
+
║ █████╗ ██║ ███╗██████╔╝██║ ███╗█████╗ ║
|
|
30
|
+
║ ██╔══╝ ██║ ██║██╔══██╗██║ ██║██╔══╝ ║
|
|
31
|
+
║ ██║ ╚██████╔╝██║ ██║╚██████╔╝███████╗ ║
|
|
32
|
+
║ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ║
|
|
33
|
+
║ ║
|
|
34
|
+
║ Self-improving AI agent framework with behavioral observability ║
|
|
35
|
+
║ and trust protocols. Built on Hermes Agent by NousResearch. ║
|
|
36
|
+
║ ║
|
|
37
|
+
║ Author: KingLabsA ║
|
|
38
|
+
║ • GitHub: https://github.com/KingLabsA ║
|
|
39
|
+
║ • Twitter: https://x.com/KingLabsA ║
|
|
40
|
+
║ • Email: kinglabsa@users.noreply.github.com ║
|
|
41
|
+
╚═══════════════════════════════════════════════════════════════╝
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
**FableForge Agent** is a self-improving AI agent framework built on top of
|
|
46
|
+
[Hermes Agent](https://github.com/NousResearch/hermes-agent) by NousResearch.
|
|
47
|
+
It extends Hermes with three additional tiers of capability:
|
|
48
|
+
|
|
49
|
+
- **Tier 3: Agent Control Plane** — Sandboxed execution, audit trails, incident
|
|
50
|
+
response, OAuth gate, and credential broker.
|
|
51
|
+
- **Tier 4: Behavioral Observability** — Real-time behavior observation,
|
|
52
|
+
semantic firewall, safety rules engine, and behavior reporting.
|
|
53
|
+
- **Tier 4: Trust Protocols** — Bidirectional agent-to-agent trust,
|
|
54
|
+
identity registry, permission framework, and cryptographic signing.
|
|
55
|
+
|
|
56
|
+
## Quickstart
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pip install fableforge-agent
|
|
60
|
+
fableforge --help
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Or run with specific subcommands:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
fableforge # Run the agent (passes through to Hermes CLI)
|
|
67
|
+
fableforge control-plane --port 8000 # Start the control plane API server
|
|
68
|
+
fableforge audit --export report.json # Export audit trail
|
|
69
|
+
fableforge trust register --agent-id agent1 --pubkey ./key.pub # Trust registry
|
|
70
|
+
fableforge observe # Start behavioral observability dashboard
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Architecture
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
┌─────────────────────────────────────────────────────┐
|
|
77
|
+
│ FableForge Agent │
|
|
78
|
+
├─────────────────────────────────────────────────────┤
|
|
79
|
+
│ Tier 4: Behavioral Observability + Trust Protocols │
|
|
80
|
+
│ ┌────────────────────┐ ┌────────────────────────┐ │
|
|
81
|
+
│ │ BehavioralObservability│ │ TrustProtocol │ │
|
|
82
|
+
│ │ SemanticFirewall │ │ IdentityRegistry │ │
|
|
83
|
+
│ │ BehaviorReport │ │ PermissionFramework │ │
|
|
84
|
+
│ └────────────────────┘ └────────────────────────┘ │
|
|
85
|
+
├─────────────────────────────────────────────────────┤
|
|
86
|
+
│ Tier 3: Agent Control Plane │
|
|
87
|
+
│ ┌────────────────────┐ ┌────────────────────────┐ │
|
|
88
|
+
│ │ Sandbox (execution)│ │ AuditTrail │ │
|
|
89
|
+
│ │ IncidentResponse │ │ OAuthGate │ │
|
|
90
|
+
│ │ CredentialBroker │ │ SandboxPolicy │ │
|
|
91
|
+
│ └────────────────────┘ └────────────────────────┘ │
|
|
92
|
+
├─────────────────────────────────────────────────────┤
|
|
93
|
+
│ Tiers 1-2: Hermes Agent Foundation │
|
|
94
|
+
│ ┌──────────────────────────────────────────────┐ │
|
|
95
|
+
│ │ AIAgent · ToolRegistry · ConversationLoop │ │
|
|
96
|
+
│ │ Model Providers · Tool Calling · Memory │ │
|
|
97
|
+
│ └──────────────────────────────────────────────┘ │
|
|
98
|
+
└─────────────────────────────────────────────────────┘
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Foundation
|
|
102
|
+
|
|
103
|
+
FableForge Agent is built on [Hermes Agent](https://github.com/NousResearch/hermes-agent)
|
|
104
|
+
by NousResearch. All credit for the underlying agent framework, tool calling,
|
|
105
|
+
conversation loop, and model provider integration belongs to the NousResearch team.
|
|
106
|
+
|
|
107
|
+
## License
|
|
108
|
+
|
|
109
|
+
Apache 2.0 — see LICENSE for details.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
╔═══════════════════════════════════════════════════════════════╗
|
|
2
|
+
║ ███████╗ █████╗ ██████╗ ██╗ ███████╗ ║
|
|
3
|
+
║ ██╔════╝██╔══██╗██╔══██╗██║ ██╔════╝ ║
|
|
4
|
+
║ █████╗ ███████║██████╔╝██║ █████╗ ║
|
|
5
|
+
║ ██╔══╝ ██╔══██║██╔══██╗██║ ██╔══╝ ║
|
|
6
|
+
║ ██║ ██║ ██║██████╔╝███████╗███████╗ ║
|
|
7
|
+
║ ╚═╝ ╚═╝ ╚═╝╚═════╝ ╚══════╝╚══════╝ ║
|
|
8
|
+
║ ███████╗ ██████╗ ██████╗ ██████╗ ███████╗ ║
|
|
9
|
+
║ ██╔════╝██╔════╝ ██╔══██╗██╔════╝ ██╔════╝ ║
|
|
10
|
+
║ █████╗ ██║ ███╗██████╔╝██║ ███╗█████╗ ║
|
|
11
|
+
║ ██╔══╝ ██║ ██║██╔══██╗██║ ██║██╔══╝ ║
|
|
12
|
+
║ ██║ ╚██████╔╝██║ ██║╚██████╔╝███████╗ ║
|
|
13
|
+
║ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ║
|
|
14
|
+
║ ║
|
|
15
|
+
║ Self-improving AI agent framework with behavioral observability ║
|
|
16
|
+
║ and trust protocols. Built on Hermes Agent by NousResearch. ║
|
|
17
|
+
║ ║
|
|
18
|
+
║ Author: KingLabsA ║
|
|
19
|
+
║ • GitHub: https://github.com/KingLabsA ║
|
|
20
|
+
║ • Twitter: https://x.com/KingLabsA ║
|
|
21
|
+
║ • Email: kinglabsa@users.noreply.github.com ║
|
|
22
|
+
╚═══════════════════════════════════════════════════════════════╝
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
**FableForge Agent** is a self-improving AI agent framework built on top of
|
|
27
|
+
[Hermes Agent](https://github.com/NousResearch/hermes-agent) by NousResearch.
|
|
28
|
+
It extends Hermes with three additional tiers of capability:
|
|
29
|
+
|
|
30
|
+
- **Tier 3: Agent Control Plane** — Sandboxed execution, audit trails, incident
|
|
31
|
+
response, OAuth gate, and credential broker.
|
|
32
|
+
- **Tier 4: Behavioral Observability** — Real-time behavior observation,
|
|
33
|
+
semantic firewall, safety rules engine, and behavior reporting.
|
|
34
|
+
- **Tier 4: Trust Protocols** — Bidirectional agent-to-agent trust,
|
|
35
|
+
identity registry, permission framework, and cryptographic signing.
|
|
36
|
+
|
|
37
|
+
## Quickstart
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pip install fableforge-agent
|
|
41
|
+
fableforge --help
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Or run with specific subcommands:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
fableforge # Run the agent (passes through to Hermes CLI)
|
|
48
|
+
fableforge control-plane --port 8000 # Start the control plane API server
|
|
49
|
+
fableforge audit --export report.json # Export audit trail
|
|
50
|
+
fableforge trust register --agent-id agent1 --pubkey ./key.pub # Trust registry
|
|
51
|
+
fableforge observe # Start behavioral observability dashboard
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Architecture
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
┌─────────────────────────────────────────────────────┐
|
|
58
|
+
│ FableForge Agent │
|
|
59
|
+
├─────────────────────────────────────────────────────┤
|
|
60
|
+
│ Tier 4: Behavioral Observability + Trust Protocols │
|
|
61
|
+
│ ┌────────────────────┐ ┌────────────────────────┐ │
|
|
62
|
+
│ │ BehavioralObservability│ │ TrustProtocol │ │
|
|
63
|
+
│ │ SemanticFirewall │ │ IdentityRegistry │ │
|
|
64
|
+
│ │ BehaviorReport │ │ PermissionFramework │ │
|
|
65
|
+
│ └────────────────────┘ └────────────────────────┘ │
|
|
66
|
+
├─────────────────────────────────────────────────────┤
|
|
67
|
+
│ Tier 3: Agent Control Plane │
|
|
68
|
+
│ ┌────────────────────┐ ┌────────────────────────┐ │
|
|
69
|
+
│ │ Sandbox (execution)│ │ AuditTrail │ │
|
|
70
|
+
│ │ IncidentResponse │ │ OAuthGate │ │
|
|
71
|
+
│ │ CredentialBroker │ │ SandboxPolicy │ │
|
|
72
|
+
│ └────────────────────┘ └────────────────────────┘ │
|
|
73
|
+
├─────────────────────────────────────────────────────┤
|
|
74
|
+
│ Tiers 1-2: Hermes Agent Foundation │
|
|
75
|
+
│ ┌──────────────────────────────────────────────┐ │
|
|
76
|
+
│ │ AIAgent · ToolRegistry · ConversationLoop │ │
|
|
77
|
+
│ │ Model Providers · Tool Calling · Memory │ │
|
|
78
|
+
│ └──────────────────────────────────────────────┘ │
|
|
79
|
+
└─────────────────────────────────────────────────────┘
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Foundation
|
|
83
|
+
|
|
84
|
+
FableForge Agent is built on [Hermes Agent](https://github.com/NousResearch/hermes-agent)
|
|
85
|
+
by NousResearch. All credit for the underlying agent framework, tool calling,
|
|
86
|
+
conversation loop, and model provider integration belongs to the NousResearch team.
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
Apache 2.0 — see LICENSE for details.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "fableforge-agent"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Self-improving AI agent framework with behavioral observability and trust protocols"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = {text = "Apache 2.0"}
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "KingLabsA", email = "kinglabsa@users.noreply.github.com"},
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
dependencies = [
|
|
17
|
+
"hermes-agent>=0.18.0",
|
|
18
|
+
"torch>=2.0.0",
|
|
19
|
+
"rich>=13.0.0",
|
|
20
|
+
"fastapi>=0.100.0",
|
|
21
|
+
"uvicorn>=0.23.0",
|
|
22
|
+
"pydantic>=2.0.0",
|
|
23
|
+
"cryptography>=41.0.0",
|
|
24
|
+
"httpx>=0.24.0",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
[project.urls]
|
|
28
|
+
"Homepage" = "https://github.com/KingLabsA/llm-training-platform"
|
|
29
|
+
"Source" = "https://github.com/KingLabsA/llm-training-platform"
|
|
30
|
+
|
|
31
|
+
[project.scripts]
|
|
32
|
+
fableforge = "fableforge_agent.cli:main"
|
|
33
|
+
|
|
34
|
+
[tool.setuptools.packages.find]
|
|
35
|
+
where = ["src"]
|
|
36
|
+
include = ["fableforge_agent*"]
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"""
|
|
2
|
+
FableForge Agent — Self-improving AI agent framework with behavioral
|
|
3
|
+
observability and trust protocols.
|
|
4
|
+
|
|
5
|
+
Built on Hermes Agent (NousResearch) with Tiers 3-4: Agent Control Plane,
|
|
6
|
+
Behavioral Observability, and Bidirectional Trust Protocols.
|
|
7
|
+
|
|
8
|
+
Author: KingLabsA
|
|
9
|
+
- GitHub: https://github.com/KingLabsA
|
|
10
|
+
- Twitter: https://x.com/KingLabsA
|
|
11
|
+
- Email: kinglabsa@users.noreply.github.com
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
__version__ = "0.1.0"
|
|
15
|
+
__author__ = "KingLabsA"
|
|
16
|
+
|
|
17
|
+
# ── Re-exported Hermes symbols ──────────────────────────────────────────────
|
|
18
|
+
try:
|
|
19
|
+
from hermes_agent import AIAgent # noqa: F401
|
|
20
|
+
except ImportError:
|
|
21
|
+
try:
|
|
22
|
+
from run_agent import AIAgent # noqa: F401
|
|
23
|
+
except ImportError:
|
|
24
|
+
AIAgent = None # graceful fallback for partial installs
|
|
25
|
+
|
|
26
|
+
try:
|
|
27
|
+
from hermes_agent import ConversationLoop # noqa: F401
|
|
28
|
+
except ImportError:
|
|
29
|
+
try:
|
|
30
|
+
from agent.conversation_loop import ConversationLoop # noqa: F401
|
|
31
|
+
except ImportError:
|
|
32
|
+
ConversationLoop = None
|
|
33
|
+
|
|
34
|
+
try:
|
|
35
|
+
from hermes_agent import ToolRegistry # noqa: F401
|
|
36
|
+
except ImportError:
|
|
37
|
+
try:
|
|
38
|
+
from tools.registry import ToolRegistry, registry # noqa: F401
|
|
39
|
+
except ImportError:
|
|
40
|
+
ToolRegistry = None
|
|
41
|
+
|
|
42
|
+
try:
|
|
43
|
+
from hermes_agent import SessionDB # noqa: F401
|
|
44
|
+
except ImportError:
|
|
45
|
+
try:
|
|
46
|
+
from hermes_state import SessionDB # noqa: F401
|
|
47
|
+
except ImportError:
|
|
48
|
+
SessionDB = None
|
|
49
|
+
|
|
50
|
+
# ── FableForge additions ────────────────────────────────────────────────────
|
|
51
|
+
from fableforge_agent.control_plane.core import ControlPlane
|
|
52
|
+
from fableforge_agent.observability.core import BehavioralObservability
|
|
53
|
+
from fableforge_agent.trust.core import TrustProtocol
|
|
54
|
+
|
|
55
|
+
__all__ = [
|
|
56
|
+
"AIAgent",
|
|
57
|
+
"ConversationLoop",
|
|
58
|
+
"ToolRegistry",
|
|
59
|
+
"SessionDB",
|
|
60
|
+
"ControlPlane",
|
|
61
|
+
"BehavioralObservability",
|
|
62
|
+
"TrustProtocol",
|
|
63
|
+
]
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
FableForge Agent CLI — wraps Hermes Agent and adds FableForge commands for
|
|
4
|
+
the control plane, observability, trust, and audit.
|
|
5
|
+
|
|
6
|
+
Author: KingLabsA
|
|
7
|
+
- GitHub: https://github.com/KingLabsA
|
|
8
|
+
- Twitter: https://x.com/KingLabsA
|
|
9
|
+
- Email: kinglabsa@users.noreply.github.com
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
import argparse
|
|
13
|
+
import json
|
|
14
|
+
import os
|
|
15
|
+
import sys
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def cmd_control_plane(args: argparse.Namespace) -> None:
|
|
19
|
+
port = args.port
|
|
20
|
+
host = args.host
|
|
21
|
+
try:
|
|
22
|
+
import uvicorn
|
|
23
|
+
from fastapi import FastAPI
|
|
24
|
+
|
|
25
|
+
app = FastAPI(title="FableForge Control Plane")
|
|
26
|
+
|
|
27
|
+
@app.get("/health")
|
|
28
|
+
def health():
|
|
29
|
+
return {"status": "ok"}
|
|
30
|
+
|
|
31
|
+
@app.get("/audit")
|
|
32
|
+
def get_audit():
|
|
33
|
+
from fableforge_agent.control_plane import AuditTrail
|
|
34
|
+
trail = AuditTrail()
|
|
35
|
+
return {"entries": trail.export("json")}
|
|
36
|
+
|
|
37
|
+
@app.post("/sandbox/execute")
|
|
38
|
+
async def sandbox_execute(body: dict):
|
|
39
|
+
from fableforge_agent.control_plane import Sandbox
|
|
40
|
+
sandbox = Sandbox(sandbox_type=body.get("backend", "mock"))
|
|
41
|
+
result = sandbox.execute(body.get("code", ""), timeout=body.get("timeout", 30))
|
|
42
|
+
return result.__dict__
|
|
43
|
+
|
|
44
|
+
uvicorn.run(app, host=host, port=port, log_level="info")
|
|
45
|
+
except ImportError as e:
|
|
46
|
+
print(f"Error: missing dependency — {e}", file=sys.stderr)
|
|
47
|
+
print("Install with: pip install 'fableforge-agent[server]'", file=sys.stderr)
|
|
48
|
+
sys.exit(1)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def cmd_audit(args: argparse.Namespace) -> None:
|
|
52
|
+
from fableforge_agent.control_plane import AuditTrail
|
|
53
|
+
|
|
54
|
+
trail = AuditTrail()
|
|
55
|
+
export_path = args.export
|
|
56
|
+
fmt = "json" if export_path and export_path.endswith(".json") else "markdown"
|
|
57
|
+
output = trail.export(fmt=fmt)
|
|
58
|
+
if export_path:
|
|
59
|
+
with open(export_path, "w") as f:
|
|
60
|
+
f.write(output)
|
|
61
|
+
print(f"Audit exported to {export_path}")
|
|
62
|
+
else:
|
|
63
|
+
print(output)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def cmd_trust(args: argparse.Namespace) -> None:
|
|
67
|
+
from fableforge_agent.trust import TrustProtocol
|
|
68
|
+
|
|
69
|
+
agent_id = args.agent_id or "cli-agent"
|
|
70
|
+
trust = TrustProtocol(agent_id=agent_id)
|
|
71
|
+
action = args.action
|
|
72
|
+
|
|
73
|
+
if action == "register":
|
|
74
|
+
pubkey = args.pubkey
|
|
75
|
+
if pubkey and os.path.exists(pubkey):
|
|
76
|
+
with open(pubkey) as f:
|
|
77
|
+
key_content = f.read().strip()
|
|
78
|
+
else:
|
|
79
|
+
key_content = pubkey or trust.public_key
|
|
80
|
+
trust.registry.register(agent_id, key_content, {"source": "cli"})
|
|
81
|
+
print(f"Registered agent: {agent_id}")
|
|
82
|
+
print(f" Public key fingerprint: {trust.public_key_fingerprint}")
|
|
83
|
+
elif action == "list":
|
|
84
|
+
agents = trust.registry.list_agents()
|
|
85
|
+
print("Registered agents:")
|
|
86
|
+
for aid in agents:
|
|
87
|
+
identity = trust.registry.resolve(aid)
|
|
88
|
+
print(f" - {aid} (trust level: {identity.trust_level if identity else '?'})")
|
|
89
|
+
elif action == "verify":
|
|
90
|
+
challenge = f"challenge-{agent_id}"
|
|
91
|
+
response = hashlib_response = __import__("hashlib").sha256(
|
|
92
|
+
f"{agent_id}:{challenge}:{trust.public_key}".encode()
|
|
93
|
+
).hexdigest()
|
|
94
|
+
valid = trust.registry.verify_identity(agent_id, challenge, response)
|
|
95
|
+
print(f"Identity verification: {'PASS' if valid else 'FAIL'}")
|
|
96
|
+
else:
|
|
97
|
+
print(f"Unknown trust action: {action}")
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def cmd_observe(args: argparse.Namespace) -> None:
|
|
101
|
+
try:
|
|
102
|
+
import uvicorn
|
|
103
|
+
from fastapi import FastAPI, WebSocket
|
|
104
|
+
|
|
105
|
+
app = FastAPI(title="FableForge Observability")
|
|
106
|
+
|
|
107
|
+
@app.websocket("/ws/observe")
|
|
108
|
+
async def observe_ws(websocket: WebSocket):
|
|
109
|
+
await websocket.accept()
|
|
110
|
+
from fableforge_agent.observability import BehavioralObservability
|
|
111
|
+
obs = BehavioralObservability(agent_id=args.agent_id or "observed")
|
|
112
|
+
while True:
|
|
113
|
+
data = await websocket.receive_json()
|
|
114
|
+
observation = obs.observe(data.get("action", "unknown"), data)
|
|
115
|
+
await websocket.send_json(observation.__dict__)
|
|
116
|
+
|
|
117
|
+
uvicorn.run(app, host=args.host, port=args.port, log_level="info")
|
|
118
|
+
except ImportError as e:
|
|
119
|
+
print(f"Error: missing dependency — {e}", file=sys.stderr)
|
|
120
|
+
sys.exit(1)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def main() -> None:
|
|
124
|
+
parser = argparse.ArgumentParser(
|
|
125
|
+
prog="fableforge",
|
|
126
|
+
description="FableForge Agent — self-improving AI agent with behavioral observability and trust",
|
|
127
|
+
epilog="Author: KingLabsA — https://github.com/KingLabsA",
|
|
128
|
+
)
|
|
129
|
+
parser.add_argument("--version", action="version", version="0.1.0")
|
|
130
|
+
|
|
131
|
+
subparsers = parser.add_subparsers(dest="command", help="Subcommands")
|
|
132
|
+
|
|
133
|
+
# control-plane
|
|
134
|
+
cp_parser = subparsers.add_parser("control-plane", help="Start the control plane API server")
|
|
135
|
+
cp_parser.add_argument("--host", default="127.0.0.1")
|
|
136
|
+
cp_parser.add_argument("--port", type=int, default=8000)
|
|
137
|
+
|
|
138
|
+
# audit
|
|
139
|
+
audit_parser = subparsers.add_parser("audit", help="Export audit trail")
|
|
140
|
+
audit_parser.add_argument("--export", dest="export_path", help="Export to file (.json or .md)")
|
|
141
|
+
|
|
142
|
+
# trust
|
|
143
|
+
trust_parser = subparsers.add_parser("trust", help="Trust registry management")
|
|
144
|
+
trust_sub = trust_parser.add_subparsers(dest="action", required=True)
|
|
145
|
+
reg_parser = trust_sub.add_parser("register", help="Register an agent")
|
|
146
|
+
reg_parser.add_argument("--agent-id", required=True)
|
|
147
|
+
reg_parser.add_argument("--pubkey", help="Public key path")
|
|
148
|
+
list_parser = trust_sub.add_parser("list", help="List registered agents")
|
|
149
|
+
list_parser.add_argument("--agent-id", default="cli-agent")
|
|
150
|
+
verify_parser = trust_sub.add_parser("verify", help="Verify identity")
|
|
151
|
+
verify_parser.add_argument("--agent-id", default="cli-agent")
|
|
152
|
+
|
|
153
|
+
# observe
|
|
154
|
+
obs_parser = subparsers.add_parser("observe", help="Start behavioral observability dashboard")
|
|
155
|
+
obs_parser.add_argument("--host", default="127.0.0.1")
|
|
156
|
+
obs_parser.add_argument("--port", type=int, default=8765)
|
|
157
|
+
obs_parser.add_argument("--agent-id", default="observed")
|
|
158
|
+
|
|
159
|
+
args = parser.parse_args()
|
|
160
|
+
|
|
161
|
+
if args.command == "control-plane":
|
|
162
|
+
cmd_control_plane(args)
|
|
163
|
+
elif args.command == "audit":
|
|
164
|
+
cmd_audit(args)
|
|
165
|
+
elif args.command == "trust":
|
|
166
|
+
cmd_trust(args)
|
|
167
|
+
elif args.command == "observe":
|
|
168
|
+
cmd_observe(args)
|
|
169
|
+
else:
|
|
170
|
+
# Default: delegate to Hermes CLI
|
|
171
|
+
try:
|
|
172
|
+
from hermes_cli.cli import main as hermes_main
|
|
173
|
+
hermes_main()
|
|
174
|
+
except ImportError:
|
|
175
|
+
try:
|
|
176
|
+
from cli import main as hermes_main
|
|
177
|
+
hermes_main()
|
|
178
|
+
except ImportError:
|
|
179
|
+
print("Hermes Agent not installed. Install with: pip install hermes-agent", file=sys.stderr)
|
|
180
|
+
sys.exit(1)
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
if __name__ == "__main__":
|
|
184
|
+
main()
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Control Plane — Tier 3 of FableForge Agent.
|
|
3
|
+
|
|
4
|
+
Sandboxed execution, audit trails, incident response, authentication, and
|
|
5
|
+
credential management for agent workloads.
|
|
6
|
+
|
|
7
|
+
Author: KingLabsA
|
|
8
|
+
- GitHub: https://github.com/KingLabsA
|
|
9
|
+
- Twitter: https://x.com/KingLabsA
|
|
10
|
+
- Email: kinglabsa@users.noreply.github.com
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from fableforge_agent.control_plane.core import (
|
|
14
|
+
ControlPlane,
|
|
15
|
+
Sandbox,
|
|
16
|
+
SandboxPolicy,
|
|
17
|
+
SandboxResult,
|
|
18
|
+
AuditTrail,
|
|
19
|
+
AuditEntry,
|
|
20
|
+
IncidentResponse,
|
|
21
|
+
)
|
|
22
|
+
from fableforge_agent.control_plane.auth import (
|
|
23
|
+
OAuthGate,
|
|
24
|
+
CredentialBroker,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
__all__ = [
|
|
28
|
+
"ControlPlane",
|
|
29
|
+
"Sandbox",
|
|
30
|
+
"SandboxPolicy",
|
|
31
|
+
"SandboxResult",
|
|
32
|
+
"AuditTrail",
|
|
33
|
+
"AuditEntry",
|
|
34
|
+
"IncidentResponse",
|
|
35
|
+
"OAuthGate",
|
|
36
|
+
"CredentialBroker",
|
|
37
|
+
]
|