nutria-plugin SDK
SDK for building, validating, signing, and packaging Nutria plugins.
Release 0.2.1 adds provider-backed world graph descriptors in manifest schema
2.1 while continuing to accept schema 2.0. ChatBotNutralia owns reviewable drafts, revisions, and approval; a
plugin only reads channel state and delivers the exact approved snapshot.
This release also supports declarative admin extensions, allowing plugins to expose safe, host-rendered operator views inside ChatBotNutralia. It also defines declarative admin flows for safe, host-rendered operator workflows such as QR/device-code login without shipping frontend code.
Install
uv add nutria-plugin
Quickstart
1. Scaffold a new plugin
nutria-plugin new my-workspace-plugin --name "My Workspace Plugin"
This creates:
my-workspace-plugin/
plugin.json # manifest — edit this
README.md
connections/ # one JSON file per connection
skills/ # SKILL.md files
context_docs/ # Markdown docs injected into persona prompts
specs/ # OpenAPI/WSDL specs
hooks/hooks.json # declarative hooks
settings.schema.json # config schema shown in admin UI
2. Edit plugin.json
{
"schema_version": "2.1",
"id": "my-workspace-plugin",
"name": "My Workspace Plugin",
"version": "0.1.0",
"description": "Connects Nutria to My Workspace tool",
"author": "Your Name",
"runtime_types": ["declarative_api"],
"required_secrets": ["API_KEY"],
"optional_secrets": ["API_REGION"],
"remote_endpoints": ["https://api.myworkspace.com"],
"capabilities": [
{
"id": "workspace.search",
"title": "Search workspace",
"description": "Read matching workspace resources.",
"effect": "read",
"tool": "search_workspace",
"connection_id": "workspace"
}
],
"world_providers": [{
"id": "workspace",
"title": "Workspace",
"description": "Authoritative workspace resources.",
"connection_id": "workspace",
"resource_types": [{
"id": "workspace.item",
"title": "Workspace item",
"description": "One stable workspace item.",
"identity_fields": ["id"],
"search_capability": "workspace.search"
}]
}]
}
For customer messages, add a reviewable_actions contract and an
external_write capability as documented in
reviewable-actions.md. Do not create a plugin
draft table or native saved-draft tool.
3. Validate
nutria-plugin validate .
# OK
4. Pack
nutria-plugin pack . --output my-workspace-plugin-0.1.0.zip
# Packed: my-workspace-plugin-0.1.0.zip
5. Sign (optional)
Generate a key pair once:
nutria-plugin keygen --out my-signing-key
# Private key: my-signing-key.pem
# Public key: my-signing-key.pub.pem
Sign before packing:
nutria-plugin sign plugin.json --key my-signing-key.pem
nutria-plugin pack . --output my-workspace-plugin-0.1.0.zip
Or sign during pack:
nutria-plugin pack . --key my-signing-key.pem --output my-workspace-plugin-0.1.0.zip
Configure the Nutria instance to trust your public key:
export NUTRIA_PLUGIN_TRUSTED_KEYS='["-----BEGIN PUBLIC KEY-----\n..."]'
Store-Scoped Settings Fields
ChatBotNutralia can render one settings input per loaded store for plugin
fields that declare the host-specific metadata below in settings.schema.json:
{
"store_dir": {
"type": "object",
"default": {},
"additionalProperties": { "type": "string" },
"x-nutria-store-scoped": true,
"x-nutria-store-default-key": "default"
}
}
This is intended for plugins whose runtime values differ per store but are still managed from one shared admin UI. The host stores values as an object like:
{
"store_dir": {
"nutrivip": "/app/cache/whatsapp/nutrivip/store",
"fire": "/app/cache/whatsapp/fire/store",
"default": "/app/cache/whatsapp/{store}/store"
}
}
Plugins should treat this as a ChatBotNutralia host extension, not generic JSON Schema behavior.
Python API
from nutria_plugin import (
PluginManifest,
load_plugin_bundle,
extract_plugin_bundle,
validate_zip,
scaffold_plugin,
pack_plugin,
validate_plugin_dir,
generate_keypair,
sign_manifest,
verify_manifest,
SignatureStatus,
)
# Parse a manifest
manifest = PluginManifest.from_file(Path("plugin.json"))
# Load from ZIP bytes
manifest = load_plugin_bundle(zip_bytes)
# Extract to disk
manifest = extract_plugin_bundle(zip_bytes, target_dir)
# Sign and verify
private_pem, public_pem = generate_keypair()
sig = sign_manifest(manifest.model_dump(), private_pem)
status = verify_manifest(manifest.model_dump())
assert status == SignatureStatus.VERIFIED
Plugin ZIP format
| Path | Description |
|---|---|
plugin.json |
Manifest (required) |
README.md |
Human-readable description |
connections/*.json |
Connection definitions |
skills/<name>/SKILL.md |
Skill instructions |
context_docs/*.md |
Docs injected into persona prompts |
specs/openapi.json |
OpenAPI spec (for openapi_bridge runtime) |
specs/service.wsdl |
WSDL spec (for soap_bridge runtime) |
hooks/hooks.json |
Declarative hooks |
settings.schema.json |
JSON Schema for configuration |
assets/icon.png |
Plugin icon |
Admin frontend extensions
Plugins can declare host-rendered admin UI extensions through
plugin.json -> admin_extensions.
These extensions are:
- declared in plugin metadata
- rendered by the Nutria host
- safer than shipping arbitrary frontend code
See docs/admin-extensions.md for the full contract.
Admin flows
Plugins can declare host-rendered operator workflows through
plugin.json -> admin_flows. Use this for non-secret interactive setup such as
QR pairing, OAuth/device-code login, or phone-code verification.
See docs/admin-flows.md for the flow contract.
Security rules
- No executable files (
.py,.js,.sh, etc.) allowed in the ZIP. - No hidden files or directories.
- No absolute paths or path traversal in ZIP entries.
- Maximum bundle size: 20 MB.
- Secrets are never stored in the ZIP — they are configured after install.
- Database-backed plugins must bind user/LLM values as SQL parameters. Standard
sqlite3is acceptable for small local state stores when queries are centralized and no user input is interpolated into SQL strings.
Runtime types
| Value | Description |
|---|---|
remote_mcp |
Plugin connects to a separately deployed MCP server |
declarative_api |
Plugin uses declarative connection JSON files (no server needed) |
openapi_bridge |
Nutria auto-generates tools from an OpenAPI/Swagger spec |
soap_bridge |
Nutria auto-generates tools from a WSDL/SOAP spec |
License
MIT
Metadata
Release files for nutria-plugin 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nutria_plugin-0.2.1.tar.gz | 86.4 kB | With provenance | Details for nutria_plugin-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nutria_plugin-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for nutria_plugin-0.2.1-py3-none-any.whl |
Total release size: 109.5 kB
Release files / nutria_plugin-0.2.1.tar.gz
| Download URL | nutria_plugin-0.2.1.tar.gz |
|---|---|
| Size | 86.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
67f03cacfdb692b64bd8cdda6c1d4ef82b01e481bd4060e69ec451888e5ade63
|
|
BLAKE2b-256 checksum How to use checksums |
04a1ab46561ac06ad944da9842ab1e3b52bdabac738fa740335c8869abc2f26e
|
| 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 8, 2026.
Transparency logRelease files / nutria_plugin-0.2.1-py3-none-any.whl
| Download URL | nutria_plugin-0.2.1-py3-none-any.whl |
|---|---|
| Size | 23.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e2a5a89b3fb7b05ded18a56b09de34894bbce821c0bfc0e1ba842b59fd8b68e0
|
|
BLAKE2b-256 checksum How to use checksums |
2d0e706c135ca9747cedd7052926ce0e72bc1bc3427d8164adc86343de0f35b1
|
| 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 8, 2026.
Transparency logSecurity for nutria-plugin 0.2.1
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
Both files in this release have been uploaded with provenance metadata.
Attestation for nutria_plugin-0.2.1.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 8, 2026.
Transparency logA 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.