Documentation
Use Ephapsys to securely manage the full lifecycle of your AI agents and their models.
Boost performance, provision with trust, enforce secure inference, and maintain audit-grade governance.
Snippets mirror the samples in the official github repo.Install the SDK & CLI v0.2.5
bash
pip install ephapsysAPI Reference (Python)
High-level classes and core methods.
| Class | Purpose | Key Methods |
|---|---|---|
| TrustedAgent | Manage signed model packages and secure lifecycle | from_package(path, org_id), bind(hardware, tpm?), register(pki, metadata?), verify(pki), is_revoked(pki), session(enforce) |
| ModulatorClient | Modulate artificial neurons with ephaptic coupling | fetch(ecm_id), load(path), validate(ecm) |
Modulation
Launch ephaptic modulation jobs to tune activation fields toward a KPI without retraining or exposing raw checkpoints.
python
1from ephapsys.modulation import ModulatorClient
2
3mc = ModulatorClient(AOC_API_URL, AOC_API_KEY)
4mc.start_job(
5 model_template_id,
6 variant="additive",
7 kpi=kpi,
8 mode="auto",
9 dataset=dataset,
10 search=search,
11)
12tpl, job_id = mc.wait_for_job_id(model_template_id)
13print("job:", job_id)Provision
Provision a signed agent package and bind it to trusted hardware.
python
1# Personalize + bind to trusted anchor
2import os
3from ephapsys import TrustedAgent
4
5agent = TrustedAgent.from_env()
6anchor = os.getenv("PERSONALIZE_ANCHOR", "tpm")
7
8result = agent.personalize(anchor=anchor)
9agent.prepare_runtime()
10print("Agent personalized via", result.get("anchor", anchor))Verify & Enforce
Verify integrity, certificate chain, revocation state, and host binding. Then wrap inference in an enforcement session.
python
1# Verify + wrap inference in an enforcement session
2ok, report = agent.verify()
3if not ok:
4 raise RuntimeError(f"Agent blocked: {report}")
5
6with agent.session(lease_seconds=1800) as session:
7 reply = agent.run("Hello, world!", model_kind="language")
8 print("response:", reply)Secure Inference
Perform inference through a policy‑enforced session. Violations block execution.
python
1# Secure inference (policy-enforced)
2ok, _ = agent.verify()
3if not ok:
4 raise RuntimeError("Agent disabled or revoked")
5
6agent.prepare_runtime()
7result = agent.run(
8 input_data="Hello, world!",
9 model_kind="language",
10)
11print(result)Revocation
Revoke agents that fail attestation or violate policy. Enforced on next verification.
python
1# Revoke certificates for a compromised agent
2resp = agent.revoke_certificates(reason="compromised_host")
3print("revoked:", resp.get("revoked", 0))