dna-sdk (Python)
Python SDK for DNA — Domain Notation of Anything: a microkernel + extensions runtime for declarative agent notation. See the repository README for the thesis, the architecture and the full Kind catalog.
Install
pip install dna-sdk # or: uv add dna-sdk
Pre-release / exact-pin alternative — from the repo:
cd packages/sdk-py
uv sync # or: pip install -e .
Optional extras: postgres, sqlite, sql (SqlAlchemySource — one
adapter for both SQL dialects, same tables; see docs/PORT-CONTRACT.md
§ "Using the SQLAlchemy adapter")
safety-ml (PII/toxicity models),
github-copilot (pure GitHub Copilot SDK binding),
all, dev.
Minimal example
from dna import Kernel
# Scan a scope (directory of YAML/Markdown manifests under .dna/)
mi = Kernel.quick("hello-genome", base_dir="examples/hello-genome/.dna")
# Every instance is identified by (apiVersion, kind, name)
for d in mi.instances:
print(d.api_version, d.kind, d.name)
# Compose agent + soul + skills + guardrails into one system prompt
print(mi.build_prompt(agent="greeter"))
Runnable version: examples/hello-genome/run.py.
Runtime-neutral definitions
Use DnaClient when an application owns the runtime but wants DNA to own its
declarative definitions. The client boots the configured source, resolves
KindDefinitions through the Kernel, applies scope/tenant composition, and
returns data-only contracts.
from dna import DnaClient
client = await DnaClient.from_env(scope="development", tenant="acme")
async with client:
# Uses Genome.spec.default_agent; pass a name only as an explicit override.
definition = await client.resolve_agent()
kinds = await client.kinds.list()
tool_kind = await client.kinds.describe("Tool")
tools = await client.instances.list("Tool")
Source selection is DNA_SOURCE_URL then base_dir / DNA_BASE_DIR, then
./.dna. ResolvedAgent, ResolvedTool, ResolvedMcpServer, and
KindDescriptor do not start a model, server, session, or event loop.
The optional GitHub Copilot binding converts one resolved definition while the consumer retains lifecycle ownership:
from dna.integrations.github_copilot import build_github_copilot_agent
agent = build_github_copilot_agent(
definition,
tools=[write_review_report],
on_permission_request=permission_handler,
)
async with agent:
session = agent.create_session()
async for chunk in agent.run(prompt, session=session, stream=True):
print(chunk.text or "", end="")
Install this binding with pip install "dna-sdk[github-copilot]". It maps the
composed prompt, model, MCP federations and confirmation policy but does not own
the Copilot CLI or execute declared tools.
Layout
dna/
├── kernel/ # Kernel (mediator over 5 ports), Instance, ManifestInstance
├── application/ # transport-neutral use cases and live source handle
├── adapters/ # filesystem (core); sqlite/postgres/sqlalchemy_ via extras
├── integrations/ # optional pure bindings to consumer-owned runtimes
├── extensions/ # helix (core Kinds) + market formats + governance
├── sync/ # lockfile + instance hashing
└── safety/ # safety pipeline (optional ML extras)
Tests
uv run pytest tests/ -v
The suite includes the market-fidelity conformance tests
(tests/test_market_conformance.py) and the golden fixtures that freeze
behavior crossing a boundary (tests/goldens/, tests/golden-fixtures/).
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 dna_sdk-0.80.0.tar.gz.
File metadata
- Download URL: dna_sdk-0.80.0.tar.gz
- Upload date:
- Size: 3.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30a95dd945f1942670a58c03bf2f07c766aa99d54912d230e3323933370c2d27
|
|
| MD5 |
b54aae040cf6bdd65489648382b75020
|
|
| BLAKE2b-256 |
d2feb73e283e095bc20633f19cfb8eb9254c2ff46dd91d85944844299f6bc385
|
Provenance
The following attestation bundles were made for dna_sdk-0.80.0.tar.gz:
Publisher:
release.yml on ruinosus/dna
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dna_sdk-0.80.0.tar.gz -
Subject digest:
30a95dd945f1942670a58c03bf2f07c766aa99d54912d230e3323933370c2d27 - Sigstore transparency entry: 2434751739
- Sigstore integration time:
-
Permalink:
ruinosus/dna@8d5336f26c9a144a23165843610389effe3f6a7d -
Branch / Tag:
refs/tags/v0.80.0 - Owner: https://github.com/ruinosus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8d5336f26c9a144a23165843610389effe3f6a7d -
Trigger Event:
push
-
Statement type:
File details
Details for the file dna_sdk-0.80.0-py3-none-any.whl.
File metadata
- Download URL: dna_sdk-0.80.0-py3-none-any.whl
- Upload date:
- Size: 1.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f16687067bbeff487afc18ccc1d25ef9f7014938ffadf7a670400f2dccfc853
|
|
| MD5 |
43555844c024df1713e139f56d49f610
|
|
| BLAKE2b-256 |
71f0b8f96b3d8f95265e33b2aa068821963ad5d507199264845bcf32356ae5cd
|
Provenance
The following attestation bundles were made for dna_sdk-0.80.0-py3-none-any.whl:
Publisher:
release.yml on ruinosus/dna
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dna_sdk-0.80.0-py3-none-any.whl -
Subject digest:
1f16687067bbeff487afc18ccc1d25ef9f7014938ffadf7a670400f2dccfc853 - Sigstore transparency entry: 2434752506
- Sigstore integration time:
-
Permalink:
ruinosus/dna@8d5336f26c9a144a23165843610389effe3f6a7d -
Branch / Tag:
refs/tags/v0.80.0 - Owner: https://github.com/ruinosus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8d5336f26c9a144a23165843610389effe3f6a7d -
Trigger Event:
push
-
Statement type: