halyn 2.0.0__tar.gz → 2.1.1__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.
- halyn-2.1.1/LICENSE +58 -0
- halyn-2.1.1/PKG-INFO +234 -0
- halyn-2.1.1/README.md +201 -0
- halyn-2.1.1/pyproject.toml +56 -0
- halyn-2.1.1/src/halyn/__init__.py +30 -0
- halyn-2.1.1/src/halyn/__main__.py +6 -0
- halyn-2.1.1/src/halyn/audit.py +280 -0
- halyn-2.1.1/src/halyn/auth.py +90 -0
- halyn-2.1.1/src/halyn/autonomy.py +264 -0
- halyn-2.1.1/src/halyn/cli.py +210 -0
- halyn-2.1.1/src/halyn/config.py +137 -0
- halyn-2.1.1/src/halyn/consent.py +245 -0
- halyn-2.1.1/src/halyn/control_plane.py +451 -0
- halyn-2.1.1/src/halyn/dashboard.py +209 -0
- halyn-2.1.1/src/halyn/discovery.py +325 -0
- halyn-2.1.1/src/halyn/drivers/__init__.py +4 -0
- halyn-2.1.1/src/halyn/drivers/browser.py +72 -0
- halyn-2.1.1/src/halyn/drivers/dds.py +158 -0
- halyn-2.1.1/src/halyn/drivers/docker.py +74 -0
- halyn-2.1.1/src/halyn/drivers/http_auto.py +261 -0
- halyn-2.1.1/src/halyn/drivers/mqtt.py +105 -0
- halyn-2.1.1/src/halyn/drivers/opcua.py +89 -0
- halyn-2.1.1/src/halyn/drivers/ros2.py +136 -0
- halyn-2.1.1/src/halyn/drivers/serial.py +228 -0
- halyn-2.1.1/src/halyn/drivers/socket_raw.py +155 -0
- halyn-2.1.1/src/halyn/drivers/ssh.py +133 -0
- halyn-2.1.1/src/halyn/drivers/unitree.py +115 -0
- halyn-2.1.1/src/halyn/drivers/websocket.py +177 -0
- halyn-2.1.1/src/halyn/engine.py +224 -0
- halyn-2.1.1/src/halyn/integrations/__init__.py +4 -0
- halyn-2.1.1/src/halyn/intent.py +242 -0
- halyn-2.1.1/src/halyn/llm.py +180 -0
- halyn-2.1.1/src/halyn/mcp.py +241 -0
- halyn-2.1.1/src/halyn/mcp_serve.py +386 -0
- halyn-2.1.1/src/halyn/memory/__init__.py +4 -0
- halyn-2.1.1/src/halyn/memory/store.py +202 -0
- halyn-2.1.1/src/halyn/nrp_bridge.py +215 -0
- halyn-2.1.1/src/halyn/py.typed +0 -0
- halyn-2.1.1/src/halyn/sanitizer.py +122 -0
- halyn-2.1.1/src/halyn/security/__init__.py +22 -0
- halyn-2.1.1/src/halyn/security/audit_guard.py +129 -0
- halyn-2.1.1/src/halyn/security/ebpf_monitor.py +212 -0
- halyn-2.1.1/src/halyn/security/fs_watch.py +208 -0
- halyn-2.1.1/src/halyn/security/process_guard.py +203 -0
- halyn-2.1.1/src/halyn/security/proxy.py +159 -0
- halyn-2.1.1/src/halyn/server.py +294 -0
- halyn-2.1.1/src/halyn/shield.py +116 -0
- halyn-2.1.1/src/halyn/types.py +118 -0
- halyn-2.1.1/src/halyn/watchdog.py +254 -0
- halyn-2.1.1/src/halyn.egg-info/PKG-INFO +234 -0
- halyn-2.1.1/src/halyn.egg-info/SOURCES.txt +55 -0
- halyn-2.1.1/src/halyn.egg-info/entry_points.txt +2 -0
- halyn-2.1.1/src/halyn.egg-info/requires.txt +10 -0
- halyn-2.1.1/tests/test_halyn.py +247 -0
- halyn-2.0.0/LICENSE +0 -21
- halyn-2.0.0/PKG-INFO +0 -80
- halyn-2.0.0/README.md +0 -60
- halyn-2.0.0/halyn/__init__.py +0 -15
- halyn-2.0.0/halyn/core.py +0 -238
- halyn-2.0.0/halyn.egg-info/PKG-INFO +0 -80
- halyn-2.0.0/halyn.egg-info/SOURCES.txt +0 -11
- halyn-2.0.0/halyn.egg-info/requires.txt +0 -5
- halyn-2.0.0/pyproject.toml +0 -32
- halyn-2.0.0/tests/test_halyn.py +0 -163
- {halyn-2.0.0 → halyn-2.1.1}/setup.cfg +0 -0
- {halyn-2.0.0 → halyn-2.1.1/src}/halyn.egg-info/dependency_links.txt +0 -0
- {halyn-2.0.0 → halyn-2.1.1/src}/halyn.egg-info/top_level.txt +0 -0
halyn-2.1.1/LICENSE
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
Business Source License 1.1
|
|
2
|
+
|
|
3
|
+
Licensor: Elmadani SALKA
|
|
4
|
+
Licensed Work: Halyn
|
|
5
|
+
The Licensed Work is (c) 2026 Elmadani SALKA
|
|
6
|
+
Change Date: 2029-03-25
|
|
7
|
+
Change License: MIT License
|
|
8
|
+
|
|
9
|
+
Additional Use Grant: You may use the Licensed Work for non-commercial purposes,
|
|
10
|
+
research, education, and personal projects free of charge.
|
|
11
|
+
Commercial use requires a separate commercial license.
|
|
12
|
+
Contact: contact@halyn.dev
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
The Business Source License (this document, or the "License") is not an Open
|
|
17
|
+
Source license. However, the Licensed Work will eventually be made available
|
|
18
|
+
under an Open Source License, as stated in this License.
|
|
19
|
+
|
|
20
|
+
License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
|
|
21
|
+
"Business Source License" is a trademark of MariaDB Corporation Ab.
|
|
22
|
+
|
|
23
|
+
Parameters
|
|
24
|
+
|
|
25
|
+
Licensor: Elmadani SALKA
|
|
26
|
+
Licensed Work: Halyn — Enforceable safety for AI agents
|
|
27
|
+
Change Date: 2029-03-25
|
|
28
|
+
Change License: MIT License
|
|
29
|
+
|
|
30
|
+
For information about alternative licensing arrangements, contact:
|
|
31
|
+
contact@halyn.dev · https://halyn.dev
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
1. Grant of Rights
|
|
36
|
+
|
|
37
|
+
The Licensor hereby grants you the right to copy, modify, create derivative
|
|
38
|
+
works, redistribute, and make non-production use of the Licensed Work.
|
|
39
|
+
|
|
40
|
+
The Licensor may make an Additional Use Grant, above, permitting limited
|
|
41
|
+
production use.
|
|
42
|
+
|
|
43
|
+
2. Change Date
|
|
44
|
+
|
|
45
|
+
After the Change Date, the Grant of Rights is governed by the Change License.
|
|
46
|
+
|
|
47
|
+
3. No Other Rights
|
|
48
|
+
|
|
49
|
+
The License does not grant you any right in any trademark or logo of Licensor.
|
|
50
|
+
|
|
51
|
+
4. Disclaimer of Warranty
|
|
52
|
+
|
|
53
|
+
UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE EXTENT
|
|
54
|
+
POSSIBLE, THE LICENSOR OFFERS THE LICENSED WORK AS-IS AND AS-AVAILABLE, AND
|
|
55
|
+
MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE LICENSED WORK,
|
|
56
|
+
WHETHER EXPRESS, IMPLIED, STATUTORY, OR OTHER.
|
|
57
|
+
|
|
58
|
+
Full BSL 1.1 text: https://mariadb.com/bsl11/
|
halyn-2.1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: halyn
|
|
3
|
+
Version: 2.1.1
|
|
4
|
+
Summary: Halyn — The governance layer for AI agents. Every action intercepted. Every decision auditable.
|
|
5
|
+
Author-email: Elmadani SALKA <contact@halyn.dev>
|
|
6
|
+
License: BSL-1.1
|
|
7
|
+
Project-URL: Homepage, https://halyn.dev
|
|
8
|
+
Project-URL: Repository, https://github.com/halyndev/halyn
|
|
9
|
+
Project-URL: Issues, https://github.com/halyndev/halyn/issues
|
|
10
|
+
Project-URL: Documentation, https://halyn.dev/docs
|
|
11
|
+
Project-URL: Changelog, https://github.com/halyndev/halyn/blob/main/CHANGELOG.md
|
|
12
|
+
Keywords: ai,agents,governance,accountability,audit,mcp,security,aap,nrp,iot,robotics
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
+
Classifier: Topic :: Security
|
|
20
|
+
Classifier: Topic :: System :: Systems Administration
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: aiohttp>=3.9
|
|
25
|
+
Provides-Extra: iot
|
|
26
|
+
Requires-Dist: paho-mqtt; extra == "iot"
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-asyncio; extra == "dev"
|
|
30
|
+
Requires-Dist: mypy; extra == "dev"
|
|
31
|
+
Requires-Dist: ruff; extra == "dev"
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
|
|
34
|
+
<div align="center">
|
|
35
|
+
|
|
36
|
+
# Halyn
|
|
37
|
+
|
|
38
|
+
**The governance layer for AI agents.**
|
|
39
|
+
|
|
40
|
+
[](https://pypi.org/project/halyn/)
|
|
41
|
+
[](https://python.org)
|
|
42
|
+
[](LICENSE)
|
|
43
|
+
[](https://halyn.dev)
|
|
44
|
+
|
|
45
|
+
Every action intercepted. Every decision auditable. The AI cannot bypass it.
|
|
46
|
+
|
|
47
|
+
[Website](https://halyn.dev) · [Why Halyn](#why-halyn) · [Install](#install) · [Architecture](#architecture) · [Protocols](#protocols)
|
|
48
|
+
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Why Halyn
|
|
54
|
+
|
|
55
|
+
AI agents — Claude, GPT-4.1, Gemini 3.1, local models — act on your machine. They read files, send emails, control browsers, call APIs. With no independent proof of what happened.
|
|
56
|
+
|
|
57
|
+
**Halyn is the independent layer that sits between any AI agent and your system.**
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
Claude / GPT-4.1 / Gemini 3.1 / Ollama / Any agent
|
|
61
|
+
│
|
|
62
|
+
▼
|
|
63
|
+
┌─────────────────────────────┐
|
|
64
|
+
│ HALYN LAYER │ ← runs locally, out of agent reach
|
|
65
|
+
│ │
|
|
66
|
+
│ • Identity — who is acting? │
|
|
67
|
+
│ • Consent — was it approved? │
|
|
68
|
+
│ • Audit — SHA-256 chain proof │
|
|
69
|
+
│ • Shield — what can it NOT do? │
|
|
70
|
+
│ • Watchdog — integrity monitoring │
|
|
71
|
+
└─────────────────────────────┘
|
|
72
|
+
│
|
|
73
|
+
▼
|
|
74
|
+
Your machine · Your files · Your system
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Every action produces a cryptographic proof stored locally. Not in the cloud. Not at Anthropic. On your machine.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Install
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
pip install halyn
|
|
85
|
+
halyn serve
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Opens the dashboard at `http://localhost:7420`. Nothing leaves your machine.
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Or with curl
|
|
92
|
+
curl -fsSL https://halyn.dev/install | bash
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The install script tells you exactly what it will do before doing anything.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Quick Start
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
from halyn import ControlPlane
|
|
103
|
+
|
|
104
|
+
# Start the governance layer
|
|
105
|
+
gov = ControlPlane()
|
|
106
|
+
gov.serve() # dashboard at localhost:7420
|
|
107
|
+
|
|
108
|
+
# Register an agent
|
|
109
|
+
agent = gov.register_agent(
|
|
110
|
+
name="claude-cowork",
|
|
111
|
+
provider="anthropic",
|
|
112
|
+
autonomy_level=2, # executor — reversible actions only
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
# Every agent action is intercepted and recorded
|
|
116
|
+
result = agent.act("read_file", "/docs/contract.pdf")
|
|
117
|
+
print(result.proof) # sha256:a3f2e1...
|
|
118
|
+
print(result.allowed) # True
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Architecture
|
|
124
|
+
|
|
125
|
+
Halyn intercepts at three independent layers simultaneously:
|
|
126
|
+
|
|
127
|
+
### Layer 1 — API Proxy
|
|
128
|
+
All LLM API calls (Claude, GPT-4.1, Gemini 3.1, etc.) pass through a local proxy on `127.0.0.1`.
|
|
129
|
+
Intent is read before transmission. Shield rules apply before the request reaches the provider.
|
|
130
|
+
Implemented via `iptables REDIRECT` — kernel-level, not a library hook.
|
|
131
|
+
|
|
132
|
+
### Layer 2 — Filesystem Hooks
|
|
133
|
+
`inotify` (Linux) / `FSEvents` (macOS) / `ReadDirectoryChanges` (Windows).
|
|
134
|
+
Every file access by an agent process is captured before execution, at the VFS layer.
|
|
135
|
+
LD_PRELOAD cannot bypass this — inotify fires in kernel space regardless.
|
|
136
|
+
|
|
137
|
+
### Layer 3 — Process Isolation + eBPF
|
|
138
|
+
Halyn runs as a separate system user. Agents cannot read or write its audit database.
|
|
139
|
+
On Linux ≥5.8: eBPF programs are pinned to `/sys/fs/bpf/halyn/` and monitor all syscalls.
|
|
140
|
+
Audit chain is SHA-256 with chained hashes, AES-256 encrypted at rest.
|
|
141
|
+
|
|
142
|
+
### Layer 4 — Browser Guard (optional)
|
|
143
|
+
Chrome Enterprise Policy extension intercepts all CDP calls, DOM mutations, XHR, and fetch.
|
|
144
|
+
Deployed via `/etc/opt/chrome/policies/managed/halyn.json` — the agent cannot uninstall it.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Autonomy Levels
|
|
149
|
+
|
|
150
|
+
| Level | Name | What the agent can do |
|
|
151
|
+
|-------|------|-----------------------|
|
|
152
|
+
| 0 | Observer | Read-only access. No mutations. |
|
|
153
|
+
| 1 | Assistant | Suggests actions. Human executes. |
|
|
154
|
+
| 2 | Executor | Executes reversible actions. |
|
|
155
|
+
| 3 | Delegated | Executes with post-hoc audit. |
|
|
156
|
+
| 4 | Autonomous | Full autonomy. Use with extreme caution. |
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Supported Agents
|
|
161
|
+
|
|
162
|
+
| Agent | Type | Integration |
|
|
163
|
+
|-------|------|-------------|
|
|
164
|
+
| Claude Sonnet 4.6 / Opus 4.6 (Anthropic) | Cloud | Proxy + MCP |
|
|
165
|
+
| GPT-4.1 / o3 (OpenAI) | Cloud | Proxy |
|
|
166
|
+
| Gemini 3.1 Pro / Flash (Google) | Cloud | Proxy |
|
|
167
|
+
| Ollama | Local | Direct |
|
|
168
|
+
| LM Studio | Local | Direct |
|
|
169
|
+
| Jan.ai | Local | Direct |
|
|
170
|
+
| OpenClaw | Agentic | Interceptor |
|
|
171
|
+
| Any MCP agent | Any | MCP server |
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Protocols
|
|
176
|
+
|
|
177
|
+
Halyn implements two open protocols:
|
|
178
|
+
|
|
179
|
+
### AAP — Agent Accountability Protocol
|
|
180
|
+
The accountability layer MCP and A2A don't have.
|
|
181
|
+
Four primitives: **Identity**, **Provenance**, **Authorization**, **Audit**.
|
|
182
|
+
Spec: [github.com/halyndev/aap](https://github.com/halyndev/aap) · License: MIT
|
|
183
|
+
|
|
184
|
+
### NRP — Node Reach Protocol
|
|
185
|
+
Safety standard for agents in physical and connected systems.
|
|
186
|
+
Six rules: **Manifest**, **Observe**, **Act**, **Shield**, **Audit**, **Consent**.
|
|
187
|
+
Spec: [github.com/halyndev/nrprotocol](https://github.com/halyndev/nrprotocol) · License: MIT
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Dashboard
|
|
192
|
+
|
|
193
|
+
The local dashboard at `http://localhost:7420` provides:
|
|
194
|
+
|
|
195
|
+
- **Live feed** — every agent action in real time, in plain language
|
|
196
|
+
- **Agents** — who is active, at what autonomy level, how to pause or stop
|
|
197
|
+
- **Audit chain** — cryptographic proof of every action since install
|
|
198
|
+
- **Rules** — configure what each agent can and cannot do
|
|
199
|
+
- **Protocols** — connected devices and integrations
|
|
200
|
+
- **Insights** — patterns, blocked actions, anomalies
|
|
201
|
+
|
|
202
|
+
The dashboard process runs under a separate system user. Agents cannot kill, read, or modify it.
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## Security Honest Statement
|
|
207
|
+
|
|
208
|
+
Halyn does not claim bypassing is impossible.
|
|
209
|
+
Halyn claims: **every bypass attempt leaves a proven trace you see first.**
|
|
210
|
+
|
|
211
|
+
Known limitations are documented in [SECURITY.md](SECURITY.md).
|
|
212
|
+
Report vulnerabilities to contact@halyn.dev — we respond within 24 hours.
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
## Contributing
|
|
217
|
+
|
|
218
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## License
|
|
223
|
+
|
|
224
|
+
**[BSL-1.1](LICENSE)** — Business Source License 1.1
|
|
225
|
+
|
|
226
|
+
- **Free** for personal use, research, and education
|
|
227
|
+
- **Commercial use** requires a license — [contact@halyn.dev](mailto:contact@halyn.dev)
|
|
228
|
+
- **Change date:** 2029-03-25 → becomes MIT automatically
|
|
229
|
+
|
|
230
|
+
Protocol specs ([AAP](https://github.com/halyndev/aap), [NRP](https://github.com/halyndev/nrprotocol)) are MIT and always will be.
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
**Author:** Elmadani SALKA · [contact@halyn.dev](mailto:contact@halyn.dev) · [halyn.dev](https://halyn.dev)
|
halyn-2.1.1/README.md
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# Halyn
|
|
4
|
+
|
|
5
|
+
**The governance layer for AI agents.**
|
|
6
|
+
|
|
7
|
+
[](https://pypi.org/project/halyn/)
|
|
8
|
+
[](https://python.org)
|
|
9
|
+
[](LICENSE)
|
|
10
|
+
[](https://halyn.dev)
|
|
11
|
+
|
|
12
|
+
Every action intercepted. Every decision auditable. The AI cannot bypass it.
|
|
13
|
+
|
|
14
|
+
[Website](https://halyn.dev) · [Why Halyn](#why-halyn) · [Install](#install) · [Architecture](#architecture) · [Protocols](#protocols)
|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Why Halyn
|
|
21
|
+
|
|
22
|
+
AI agents — Claude, GPT-4.1, Gemini 3.1, local models — act on your machine. They read files, send emails, control browsers, call APIs. With no independent proof of what happened.
|
|
23
|
+
|
|
24
|
+
**Halyn is the independent layer that sits between any AI agent and your system.**
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
Claude / GPT-4.1 / Gemini 3.1 / Ollama / Any agent
|
|
28
|
+
│
|
|
29
|
+
▼
|
|
30
|
+
┌─────────────────────────────┐
|
|
31
|
+
│ HALYN LAYER │ ← runs locally, out of agent reach
|
|
32
|
+
│ │
|
|
33
|
+
│ • Identity — who is acting? │
|
|
34
|
+
│ • Consent — was it approved? │
|
|
35
|
+
│ • Audit — SHA-256 chain proof │
|
|
36
|
+
│ • Shield — what can it NOT do? │
|
|
37
|
+
│ • Watchdog — integrity monitoring │
|
|
38
|
+
└─────────────────────────────┘
|
|
39
|
+
│
|
|
40
|
+
▼
|
|
41
|
+
Your machine · Your files · Your system
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Every action produces a cryptographic proof stored locally. Not in the cloud. Not at Anthropic. On your machine.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Install
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install halyn
|
|
52
|
+
halyn serve
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Opens the dashboard at `http://localhost:7420`. Nothing leaves your machine.
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Or with curl
|
|
59
|
+
curl -fsSL https://halyn.dev/install | bash
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The install script tells you exactly what it will do before doing anything.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Quick Start
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
from halyn import ControlPlane
|
|
70
|
+
|
|
71
|
+
# Start the governance layer
|
|
72
|
+
gov = ControlPlane()
|
|
73
|
+
gov.serve() # dashboard at localhost:7420
|
|
74
|
+
|
|
75
|
+
# Register an agent
|
|
76
|
+
agent = gov.register_agent(
|
|
77
|
+
name="claude-cowork",
|
|
78
|
+
provider="anthropic",
|
|
79
|
+
autonomy_level=2, # executor — reversible actions only
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
# Every agent action is intercepted and recorded
|
|
83
|
+
result = agent.act("read_file", "/docs/contract.pdf")
|
|
84
|
+
print(result.proof) # sha256:a3f2e1...
|
|
85
|
+
print(result.allowed) # True
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Architecture
|
|
91
|
+
|
|
92
|
+
Halyn intercepts at three independent layers simultaneously:
|
|
93
|
+
|
|
94
|
+
### Layer 1 — API Proxy
|
|
95
|
+
All LLM API calls (Claude, GPT-4.1, Gemini 3.1, etc.) pass through a local proxy on `127.0.0.1`.
|
|
96
|
+
Intent is read before transmission. Shield rules apply before the request reaches the provider.
|
|
97
|
+
Implemented via `iptables REDIRECT` — kernel-level, not a library hook.
|
|
98
|
+
|
|
99
|
+
### Layer 2 — Filesystem Hooks
|
|
100
|
+
`inotify` (Linux) / `FSEvents` (macOS) / `ReadDirectoryChanges` (Windows).
|
|
101
|
+
Every file access by an agent process is captured before execution, at the VFS layer.
|
|
102
|
+
LD_PRELOAD cannot bypass this — inotify fires in kernel space regardless.
|
|
103
|
+
|
|
104
|
+
### Layer 3 — Process Isolation + eBPF
|
|
105
|
+
Halyn runs as a separate system user. Agents cannot read or write its audit database.
|
|
106
|
+
On Linux ≥5.8: eBPF programs are pinned to `/sys/fs/bpf/halyn/` and monitor all syscalls.
|
|
107
|
+
Audit chain is SHA-256 with chained hashes, AES-256 encrypted at rest.
|
|
108
|
+
|
|
109
|
+
### Layer 4 — Browser Guard (optional)
|
|
110
|
+
Chrome Enterprise Policy extension intercepts all CDP calls, DOM mutations, XHR, and fetch.
|
|
111
|
+
Deployed via `/etc/opt/chrome/policies/managed/halyn.json` — the agent cannot uninstall it.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Autonomy Levels
|
|
116
|
+
|
|
117
|
+
| Level | Name | What the agent can do |
|
|
118
|
+
|-------|------|-----------------------|
|
|
119
|
+
| 0 | Observer | Read-only access. No mutations. |
|
|
120
|
+
| 1 | Assistant | Suggests actions. Human executes. |
|
|
121
|
+
| 2 | Executor | Executes reversible actions. |
|
|
122
|
+
| 3 | Delegated | Executes with post-hoc audit. |
|
|
123
|
+
| 4 | Autonomous | Full autonomy. Use with extreme caution. |
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Supported Agents
|
|
128
|
+
|
|
129
|
+
| Agent | Type | Integration |
|
|
130
|
+
|-------|------|-------------|
|
|
131
|
+
| Claude Sonnet 4.6 / Opus 4.6 (Anthropic) | Cloud | Proxy + MCP |
|
|
132
|
+
| GPT-4.1 / o3 (OpenAI) | Cloud | Proxy |
|
|
133
|
+
| Gemini 3.1 Pro / Flash (Google) | Cloud | Proxy |
|
|
134
|
+
| Ollama | Local | Direct |
|
|
135
|
+
| LM Studio | Local | Direct |
|
|
136
|
+
| Jan.ai | Local | Direct |
|
|
137
|
+
| OpenClaw | Agentic | Interceptor |
|
|
138
|
+
| Any MCP agent | Any | MCP server |
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Protocols
|
|
143
|
+
|
|
144
|
+
Halyn implements two open protocols:
|
|
145
|
+
|
|
146
|
+
### AAP — Agent Accountability Protocol
|
|
147
|
+
The accountability layer MCP and A2A don't have.
|
|
148
|
+
Four primitives: **Identity**, **Provenance**, **Authorization**, **Audit**.
|
|
149
|
+
Spec: [github.com/halyndev/aap](https://github.com/halyndev/aap) · License: MIT
|
|
150
|
+
|
|
151
|
+
### NRP — Node Reach Protocol
|
|
152
|
+
Safety standard for agents in physical and connected systems.
|
|
153
|
+
Six rules: **Manifest**, **Observe**, **Act**, **Shield**, **Audit**, **Consent**.
|
|
154
|
+
Spec: [github.com/halyndev/nrprotocol](https://github.com/halyndev/nrprotocol) · License: MIT
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Dashboard
|
|
159
|
+
|
|
160
|
+
The local dashboard at `http://localhost:7420` provides:
|
|
161
|
+
|
|
162
|
+
- **Live feed** — every agent action in real time, in plain language
|
|
163
|
+
- **Agents** — who is active, at what autonomy level, how to pause or stop
|
|
164
|
+
- **Audit chain** — cryptographic proof of every action since install
|
|
165
|
+
- **Rules** — configure what each agent can and cannot do
|
|
166
|
+
- **Protocols** — connected devices and integrations
|
|
167
|
+
- **Insights** — patterns, blocked actions, anomalies
|
|
168
|
+
|
|
169
|
+
The dashboard process runs under a separate system user. Agents cannot kill, read, or modify it.
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Security Honest Statement
|
|
174
|
+
|
|
175
|
+
Halyn does not claim bypassing is impossible.
|
|
176
|
+
Halyn claims: **every bypass attempt leaves a proven trace you see first.**
|
|
177
|
+
|
|
178
|
+
Known limitations are documented in [SECURITY.md](SECURITY.md).
|
|
179
|
+
Report vulnerabilities to contact@halyn.dev — we respond within 24 hours.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Contributing
|
|
184
|
+
|
|
185
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## License
|
|
190
|
+
|
|
191
|
+
**[BSL-1.1](LICENSE)** — Business Source License 1.1
|
|
192
|
+
|
|
193
|
+
- **Free** for personal use, research, and education
|
|
194
|
+
- **Commercial use** requires a license — [contact@halyn.dev](mailto:contact@halyn.dev)
|
|
195
|
+
- **Change date:** 2029-03-25 → becomes MIT automatically
|
|
196
|
+
|
|
197
|
+
Protocol specs ([AAP](https://github.com/halyndev/aap), [NRP](https://github.com/halyndev/nrprotocol)) are MIT and always will be.
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
**Author:** Elmadani SALKA · [contact@halyn.dev](mailto:contact@halyn.dev) · [halyn.dev](https://halyn.dev)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "halyn"
|
|
3
|
+
version = "2.1.1"
|
|
4
|
+
description = "Halyn — The governance layer for AI agents. Every action intercepted. Every decision auditable."
|
|
5
|
+
requires-python = ">=3.10"
|
|
6
|
+
license = {text = "BSL-1.1"}
|
|
7
|
+
authors = [{name = "Elmadani SALKA", email = "contact@halyn.dev"}]
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
keywords = [
|
|
10
|
+
"ai", "agents", "governance", "accountability", "audit",
|
|
11
|
+
"mcp", "security", "aap", "nrp", "iot", "robotics"
|
|
12
|
+
]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 4 - Beta",
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"Programming Language :: Python :: 3.10",
|
|
17
|
+
"Programming Language :: Python :: 3.11",
|
|
18
|
+
"Programming Language :: Python :: 3.12",
|
|
19
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
20
|
+
"Topic :: Security",
|
|
21
|
+
"Topic :: System :: Systems Administration",
|
|
22
|
+
]
|
|
23
|
+
dependencies = [
|
|
24
|
+
"aiohttp>=3.9",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
[project.optional-dependencies]
|
|
28
|
+
iot = ["paho-mqtt"]
|
|
29
|
+
dev = ["pytest", "pytest-asyncio", "mypy", "ruff"]
|
|
30
|
+
|
|
31
|
+
[project.urls]
|
|
32
|
+
Homepage = "https://halyn.dev"
|
|
33
|
+
Repository = "https://github.com/halyndev/halyn"
|
|
34
|
+
Issues = "https://github.com/halyndev/halyn/issues"
|
|
35
|
+
Documentation = "https://halyn.dev/docs"
|
|
36
|
+
Changelog = "https://github.com/halyndev/halyn/blob/main/CHANGELOG.md"
|
|
37
|
+
|
|
38
|
+
[project.scripts]
|
|
39
|
+
halyn = "halyn.cli:main"
|
|
40
|
+
|
|
41
|
+
[tool.setuptools.packages.find]
|
|
42
|
+
where = ["src"]
|
|
43
|
+
|
|
44
|
+
[tool.setuptools.package-data]
|
|
45
|
+
halyn = ["py.typed"]
|
|
46
|
+
|
|
47
|
+
[build-system]
|
|
48
|
+
requires = ["setuptools>=68", "wheel"]
|
|
49
|
+
build-backend = "setuptools.build_meta"
|
|
50
|
+
|
|
51
|
+
[tool.ruff]
|
|
52
|
+
line-length = 100
|
|
53
|
+
target-version = "py310"
|
|
54
|
+
|
|
55
|
+
[tool.pytest.ini_options]
|
|
56
|
+
asyncio_mode = "auto"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Copyright (c) 2026 Elmadani SALKA
|
|
2
|
+
# Licensed under BSL-1.1. See LICENSE file.
|
|
3
|
+
# Commercial use requires a license — contact@halyn.dev
|
|
4
|
+
|
|
5
|
+
"""
|
|
6
|
+
Halyn — The governance layer for AI agents.
|
|
7
|
+
|
|
8
|
+
Every action intercepted. Every decision auditable.
|
|
9
|
+
The AI cannot bypass it.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
__version__ = "2.1.1"
|
|
13
|
+
__author__ = "Elmadani SALKA"
|
|
14
|
+
__license__ = "BSL-1.1"
|
|
15
|
+
__email__ = "contact@halyn.dev"
|
|
16
|
+
__url__ = "https://halyn.dev"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _try(module, cls):
|
|
20
|
+
try:
|
|
21
|
+
mod = __import__(module, fromlist=[cls])
|
|
22
|
+
return getattr(mod, cls)
|
|
23
|
+
except (ImportError, AttributeError):
|
|
24
|
+
return None
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
# Core exports
|
|
28
|
+
ControlPlane = _try("halyn.control_plane", "ControlPlane")
|
|
29
|
+
AuditChain = _try("halyn.audit", "AuditChain")
|
|
30
|
+
Shield = _try("halyn.shield", "Shield")
|