Skip to main content

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/).

Metadata

Release files for dna-sdk 0.80.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dna-sdk 0.80.0
File Size Uploaded Provenance Actions
dna_sdk-0.80.0.tar.gz 3.0 MB With provenance Details for dna_sdk-0.80.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dna-sdk 0.80.0
File Interpreter ABI Platform Actions
dna_sdk-0.80.0-py3-none-any.whl Python 3 none any Details for dna_sdk-0.80.0-py3-none-any.whl

Total release size: 4.8 MB

Release files / dna_sdk-0.80.0.tar.gz

Download URL dna_sdk-0.80.0.tar.gz
Size 3.0 MB
Tags Source
SHA-256 checksum
How to use checksums
30a95dd945f1942670a58c03bf2f07c766aa99d54912d230e3323933370c2d27
BLAKE2b-256 checksum
How to use checksums
d2feb73e283e095bc20633f19cfb8eb9254c2ff46dd91d85944844299f6bc385
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.

Transparency log

Release files / dna_sdk-0.80.0-py3-none-any.whl

Download URL dna_sdk-0.80.0-py3-none-any.whl
Size 1.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
1f16687067bbeff487afc18ccc1d25ef9f7014938ffadf7a670400f2dccfc853
BLAKE2b-256 checksum
How to use checksums
71f0b8f96b3d8f95265e33b2aa068821963ad5d507199264845bcf32356ae5cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.

Transparency log

Security for dna-sdk 0.80.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dna_sdk-0.80.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.80.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page