Library-only Sentinel core (policy, orchestration, MCP/tool plugins, audit sinks)
Project description
senteniel-core-fks (Python)
senteniel-core-fks is the library-first Sentinel package:
- no required port
- no required HTTP server
- pluggable MCP/tool backends
- pluggable orchestrators
- pluggable audit sinks
The existing SentinelClient (GraphQL remote client) is still available.
Both imports are supported:
from sentinel_core import ...(preferred)from sentinel_sdk import ...(backward compatible)
Install (editable)
pip install -e sdk
Install from PyPI:
pip install senteniel-core-fks
Published package name: senteniel-core-fks.
Local Library Usage (No Server)
from sentinel_core import (
SentinelEngine,
StaticToolBackend,
InMemoryAuditSink,
make_policy_engine_from_dict,
)
backend = StaticToolBackend(
{
"openbnb_airbnb.airbnb_search": lambda args: {"ok": True, "args": args},
}
)
policy = make_policy_engine_from_dict(
{
"openbnb_airbnb.": {
"decision": "ALLOW",
"risk": 0.0,
"reason": "Airbnb read tools allowed",
}
}
)
audit = InMemoryAuditSink()
engine = SentinelEngine(tool_backend=backend, policy_engine=policy, audit_sinks=[audit])
engine.sync_tools()
decision = engine.propose_tool_call(
"openbnb_airbnb.airbnb_search",
{"location": "Accra"},
)
print(decision)
print(audit.events[-1])
Audit Sinks
InMemoryAuditSink: captures events in memory (eventslist).JsonlAuditSink: appends one JSON event per line to a file.HttpAuditSink: sends events to an external endpoint.
Orchestrator Plugin Example
from sentinel_core import SentinelEngine, ExplicitToolCallOrchestrator, StaticToolBackend
backend = StaticToolBackend({"demo.echo": lambda args: args})
engine = SentinelEngine(tool_backend=backend, allow_unknown_tools=True)
engine.register_orchestrator(ExplicitToolCallOrchestrator())
engine.sync_tools()
result = engine.run("explicit", 'demo.echo {"msg":"hello"}')
print(result)
Remote GraphQL Client (Optional)
from sentinel_core import SentinelClient
client = SentinelClient("http://localhost:8000/graphql")
result = client.propose_tool_call("fs.list_dir", {"path": "/sandbox"})
print(result)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file senteniel_core_fks-0.0.2.tar.gz.
File metadata
- Download URL: senteniel_core_fks-0.0.2.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58647678be1b8d95cb8c6710db0e03f0c0d8c6d701da0b959ebd090e183b859e
|
|
| MD5 |
f43fb64fbac4cb735af31e7d0ce31b7d
|
|
| BLAKE2b-256 |
b85c72b1316bba3f5284c1aef764eeb48545438730e9d1b19a22c41c00ef5872
|
File details
Details for the file senteniel_core_fks-0.0.2-py3-none-any.whl.
File metadata
- Download URL: senteniel_core_fks-0.0.2-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a07fb0ff7a4223574b15ca6c1f4273f37d6ba9ada4ee4e1a586a53282e3fcbf
|
|
| MD5 |
2cf211b4dba9fc92a7345dd13cbd8a9f
|
|
| BLAKE2b-256 |
82b1bc5d6bd0789ba53db2fbdaa52b6de5c6b0e0e27389972df8a120bd2c9099
|