rbek 0.2.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.
@@ -0,0 +1,210 @@
1
+ Metadata-Version: 2.4
2
+ Name: rbek
3
+ Version: 0.2.0
4
+ Summary: Official bootstrap CLI for RBEK governed execution.
5
+ Author: RBEK Platform
6
+ Project-URL: Homepage, https://rbekplatform.com
7
+ Project-URL: Repository, https://github.com/rbekplatform/rbek
8
+ Keywords: ai-agents,ai-governance,execution-governance,policy-enforcement,workflow-automation
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
17
+ Classifier: Topic :: Security
18
+ Requires-Python: >=3.10
19
+ Description-Content-Type: text/markdown
20
+
21
+ # RBEK
22
+
23
+ **Governed execution for AI agents, workflows and software.**
24
+
25
+ [![Deterministic Execution Verified](https://github.com/rbekplatform/rbek/actions/workflows/real-governed-agent.yml/badge.svg)](https://github.com/rbekplatform/rbek/actions/workflows/real-governed-agent.yml)
26
+ [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/rbekplatform/rbek?quickstart=1)
27
+
28
+ RBEK separates what an agent **wants to do** from what it is **authorized to execute**.
29
+
30
+ ## See RBEK govern an action in 10 seconds
31
+
32
+ ```bash
33
+ curl -fsSL https://raw.githubusercontent.com/rbekplatform/rbek/main/examples/real-governed-agent/demo.sh | bash
34
+ ```
35
+
36
+ **No API key. No prior RBEK installation. No configuration.**
37
+
38
+ The demo installs and validates the public RBEK CLI when needed, then runs an
39
+ offline governed proof:
40
+
41
+ ```text
42
+ Agent requests an action
43
+ |
44
+ +-- unauthorized -> DENY -> executed: NO
45
+ |
46
+ +-- authorized -> ALLOW -> governed dry-run -> AUTHORIZED
47
+ |
48
+ +-- evidence
49
+ ```
50
+
51
+ What you see in the terminal:
52
+
53
+ ```text
54
+ Unauthorized action ............ DENIED
55
+ Denied action executed ......... NO
56
+ Authorized action .............. ALLOWED
57
+ Governed dry-run ............... PASS
58
+ Gate authorization ............. AUTHORIZED
59
+ RBEK policy enforcement ........ REAL
60
+ RBEK evidence .................. REAL
61
+ ```
62
+
63
+ The default proof performs **no external network action**. Policy enforcement
64
+ and evidence generation are real RBEK behavior.
65
+
66
+ The public GitHub Actions workflow executes the proof twice and verifies that
67
+ the deterministic evidence summary is identical across both runs.
68
+
69
+ ### Prefer zero-install in the browser?
70
+
71
+ Use **Open in GitHub Codespaces** above, then run:
72
+
73
+ ```bash
74
+ cd examples/real-governed-agent
75
+ ./demo.sh
76
+ ```
77
+
78
+ ### Want the real AI + Internet path?
79
+
80
+ ```bash
81
+ cd examples/real-governed-agent
82
+ export OPENAI_API_KEY="your-key"
83
+ ./demo.sh --live
84
+ ```
85
+
86
+ Live mode performs real model inference and a real Open-Meteo external action
87
+ through the RBEK governed execution boundary.
88
+
89
+ ## Why RBEK?
90
+
91
+ AI agents can decide what they want to do. Production systems still need a
92
+ controlled boundary for what is actually allowed to execute.
93
+
94
+ RBEK puts that boundary between application logic and real external actions:
95
+
96
+ ```text
97
+ agent / workflow
98
+
99
+ execution request
100
+
101
+ RBEK policy admission
102
+ ↙ ↘
103
+ DENY ALLOW
104
+
105
+ execute
106
+
107
+ evidence
108
+ ```
109
+
110
+ This keeps execution governance separate from the agent framework, model
111
+ provider or workflow engine.
112
+
113
+ ## Install
114
+
115
+ ```bash
116
+ curl -fsSL https://releases.rbekplatform.com/cli/stable/install.sh | bash
117
+ ```
118
+
119
+ Verify:
120
+
121
+ ```bash
122
+ rbek-cli --version
123
+ ```
124
+
125
+ Current public stable:
126
+
127
+ ```text
128
+ RBEK 0.2.0
129
+ ```
130
+
131
+ ## 5-minute quickstart
132
+
133
+ Create and run a minimal local RBEK project:
134
+
135
+ ```bash
136
+ rbek-cli init ./rbek-demo
137
+ rbek-cli run ./rbek-demo
138
+ ```
139
+
140
+ Or run the repository example:
141
+
142
+ ```bash
143
+ bash examples/5-minute-quickstart/run.sh
144
+ ```
145
+
146
+ The goal of the first five minutes is simple: install RBEK, create a governed
147
+ local project and execute it through the RBEK CLI.
148
+
149
+ See [QUICKSTART.md](QUICKSTART.md) for the complete first-run walkthrough.
150
+
151
+ ## Run the live AI + Internet version
152
+
153
+ After the zero-key proof, you can run the real agent path:
154
+
155
+ ```bash
156
+ cd examples/real-governed-agent
157
+ export OPENAI_API_KEY="your-key"
158
+ ./demo.sh --live
159
+ ```
160
+
161
+ In live mode:
162
+
163
+ ```text
164
+ OpenAI agent
165
+
166
+ weather.current
167
+
168
+ RBEK policy admission
169
+
170
+ controlled external execution
171
+
172
+ Open-Meteo
173
+
174
+ receipt + certification
175
+ ```
176
+
177
+ The agent does not call Open-Meteo directly. The external action goes through
178
+ the RBEK governed execution boundary.
179
+
180
+ See
181
+ [examples/real-governed-agent/README.md](examples/real-governed-agent/README.md)
182
+ for details.
183
+
184
+ ## Developer
185
+
186
+ Developer is the public CLI entry point for local development, evaluation and
187
+ integration.
188
+
189
+ It does not require a paid commercial entitlement.
190
+
191
+ Team and Enterprise commercial access are handled separately.
192
+
193
+ ## Repository role
194
+
195
+ This repository contains Developer documentation, examples and installation
196
+ guidance.
197
+
198
+ The RBEK runtime is distributed through the official release host:
199
+
200
+ `https://releases.rbekplatform.com`
201
+
202
+ The complete runtime source is not published in this repository.
203
+
204
+ ## Website
205
+
206
+ `https://rbekplatform.com`
207
+
208
+ ## Security
209
+
210
+ See [SECURITY.md](SECURITY.md).
@@ -0,0 +1,7 @@
1
+ rbek_pypi/__init__.py,sha256=H5NHUmfcrHD0wk_K7HrQonoLpKD-lu-NoJ-swqM3NbI,69
2
+ rbek_pypi/cli.py,sha256=aDSJiSV1Q-0LdhVHX7LaqT0WV7YlnXLDpcltrXQA_q4,3992
3
+ rbek-0.2.0.dist-info/METADATA,sha256=dN934JM65Y4kbm3D4NR-2VMyhExqMM0kPfal20pPclQ,5309
4
+ rbek-0.2.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
5
+ rbek-0.2.0.dist-info/entry_points.txt,sha256=LDt7BlAjdNXJE1Vdx0AwgCOiJBoAPyd4zXSmWKbNRVc,44
6
+ rbek-0.2.0.dist-info/top_level.txt,sha256=3zLR7Y0Jsnb6jKBvbd5TpBKJIwl4JTy9h6DKt9PiN9M,10
7
+ rbek-0.2.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ rbek = rbek_pypi.cli:main
@@ -0,0 +1 @@
1
+ rbek_pypi
rbek_pypi/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ """Public PyPI bootstrap package for RBEK."""
2
+
3
+ __version__ = "0.2.0"
rbek_pypi/cli.py ADDED
@@ -0,0 +1,167 @@
1
+ from __future__ import annotations
2
+
3
+ import hashlib
4
+ import os
5
+ import pathlib
6
+ import shutil
7
+ import subprocess
8
+ import sys
9
+ import tempfile
10
+ import urllib.request
11
+
12
+ EXPECTED_RUNTIME_VERSION = "0.2.0"
13
+ EXPECTED_RUNTIME_VERSION_OUTPUT = f"RBEK {EXPECTED_RUNTIME_VERSION}"
14
+
15
+ INSTALLER_URL = "https://releases.rbekplatform.com/cli/stable/install.sh"
16
+ INSTALLER_SHA256 = "0a3fabcad4c114c133b96cb71e1406d25279c2c05fa3b37f95a8e446a10b7c86"
17
+
18
+ DEMO_URL = (
19
+ "https://raw.githubusercontent.com/"
20
+ "rbekplatform/rbek/main/examples/real-governed-agent/demo.sh"
21
+ )
22
+ DEMO_SHA256 = "17d299b02a38aec3f722ead47153a82e0f28be2c208d6a099590984e978df2d6"
23
+
24
+ RUNTIME_COMMAND = "rbek-cli"
25
+
26
+
27
+ class RbekBootstrapError(RuntimeError):
28
+ pass
29
+
30
+
31
+ def _sha256(data: bytes) -> str:
32
+ return hashlib.sha256(data).hexdigest()
33
+
34
+
35
+ def _download_verified(url: str, expected_sha256: str) -> bytes:
36
+ request = urllib.request.Request(
37
+ url,
38
+ headers={"User-Agent": "rbek-pypi-bootstrap/0.2.0"},
39
+ )
40
+
41
+ with urllib.request.urlopen(request, timeout=30) as response:
42
+ data = response.read()
43
+
44
+ actual = _sha256(data)
45
+
46
+ if actual != expected_sha256:
47
+ raise RbekBootstrapError(
48
+ "Downloaded RBEK artifact failed SHA256 validation: "
49
+ f"expected={expected_sha256} actual={actual}"
50
+ )
51
+
52
+ return data
53
+
54
+
55
+ def _runtime_path() -> str | None:
56
+ return shutil.which(RUNTIME_COMMAND)
57
+
58
+
59
+ def _runtime_version(runtime: str) -> str:
60
+ completed = subprocess.run(
61
+ [runtime, "--version"],
62
+ check=True,
63
+ capture_output=True,
64
+ text=True,
65
+ )
66
+ return completed.stdout.strip()
67
+
68
+
69
+ def _validate_runtime(runtime: str) -> None:
70
+ actual = _runtime_version(runtime)
71
+
72
+ if actual != EXPECTED_RUNTIME_VERSION_OUTPUT:
73
+ raise RbekBootstrapError(
74
+ "RBEK runtime version mismatch: "
75
+ f"expected={EXPECTED_RUNTIME_VERSION_OUTPUT!r} "
76
+ f"actual={actual!r}"
77
+ )
78
+
79
+
80
+ def _install_runtime() -> str:
81
+ installer = _download_verified(
82
+ INSTALLER_URL,
83
+ INSTALLER_SHA256,
84
+ )
85
+
86
+ with tempfile.TemporaryDirectory(prefix="rbek-pypi-install-") as tmp:
87
+ path = pathlib.Path(tmp) / "install.sh"
88
+ path.write_bytes(installer)
89
+ path.chmod(0o700)
90
+
91
+ subprocess.run(
92
+ ["bash", str(path)],
93
+ check=True,
94
+ stdout=sys.stderr,
95
+ stderr=sys.stderr,
96
+ )
97
+
98
+ runtime = _runtime_path()
99
+
100
+ if runtime is None:
101
+ raise RbekBootstrapError(
102
+ "RBEK installer completed but rbek-cli was not found in PATH."
103
+ )
104
+
105
+ _validate_runtime(runtime)
106
+ return runtime
107
+
108
+
109
+ def ensure_runtime() -> str:
110
+ runtime = _runtime_path()
111
+
112
+ if runtime is None:
113
+ runtime = _install_runtime()
114
+ else:
115
+ _validate_runtime(runtime)
116
+
117
+ return runtime
118
+
119
+
120
+ def run_demo() -> int:
121
+ demo = _download_verified(
122
+ DEMO_URL,
123
+ DEMO_SHA256,
124
+ )
125
+
126
+ with tempfile.TemporaryDirectory(prefix="rbek-pypi-demo-") as tmp:
127
+ path = pathlib.Path(tmp) / "demo.sh"
128
+ path.write_bytes(demo)
129
+ path.chmod(0o700)
130
+
131
+ completed = subprocess.run(
132
+ ["bash", str(path)],
133
+ check=False,
134
+ )
135
+
136
+ return int(completed.returncode)
137
+
138
+
139
+ def _delegate(runtime: str, args: list[str]) -> int:
140
+ completed = subprocess.run(
141
+ [runtime, *args],
142
+ check=False,
143
+ )
144
+ return int(completed.returncode)
145
+
146
+
147
+ def main() -> None:
148
+ args = sys.argv[1:]
149
+
150
+ try:
151
+ if args == ["demo"]:
152
+ ensure_runtime()
153
+ raise SystemExit(run_demo())
154
+
155
+ runtime = ensure_runtime()
156
+ raise SystemExit(_delegate(runtime, args))
157
+
158
+ except KeyboardInterrupt:
159
+ raise SystemExit(130)
160
+
161
+ except RbekBootstrapError as exc:
162
+ print(f"RBEK bootstrap error: {exc}", file=sys.stderr)
163
+ raise SystemExit(2)
164
+
165
+ except (OSError, subprocess.SubprocessError) as exc:
166
+ print(f"RBEK bootstrap failure: {exc}", file=sys.stderr)
167
+ raise SystemExit(3)