Status: Draft — not scheduled for v1
Read RFC-0043 first; it constrains this document. Where the two disagree, RFC-0043 wins.
Three constraints from RFC-0043 apply to everything below:
- WASM/WASI is the only isolation target. Native libraries, arbitrary subprocesses, and embedded interpreters are not supported on any profile. A menu of isolation mechanisms means the weakest one defines the system's security.
- Plugins are installed at user scope and requested by name from a project (RFC-0054). Project-local plugins are never supported: a project that can carry executable code makes cloning a repository equivalent to running it.
- Plugins are capability subjects (RFC-0018) with handle-based, narrow host access. They never borrow the calling session's authority, and their output is
UNTRUSTED(RFC-0027).No plugin host ships in v1. MCP (RFC-0031) is the v1 extension mechanism: out-of-process by construction, already standardized, and sufficient for the integrations plugins would serve. The plugin host is built after MCP has proven the extension boundary against real third-party code. Plugin authors should not build against this document until it and RFC-0043 are marked Accepted.
The Plugin SDK enables developers to extend Aidos with custom functionality: Knowledge sources, AI models, Tools, Instructions, media handlers, importers, and exporters. Plugins are isolated processes or libraries that integrate via well-defined interfaces. All plugins operate under capability-based security (RFC-0003) and are sandboxed to prevent malicious behavior.
Aidos is extensible from day one:
- Knowledge sources: Custom data sources (databases, APIs, internal wikis).
- Models: Integrate specialized AI models or providers.
- Tools: Custom tools beyond Git, filesystem, shell.
- Instructions: Domain-specific instruction sets.
- Media: Custom media types and viewers.
- Importers: Import from external formats or systems.
- Exporters: Export to specialized formats.
Plugin SDK provides a stable API for these extensions without requiring Aidos core modifications.
- Define plugin architecture: How are plugins discovered and loaded?
- Specify plugin types: What can plugins implement?
- Establish capability model: How are permissions enforced?
- Clarify API stability: How are breaking changes handled?
- Explain lifecycle: Installation, activation, deactivation, removal.
- Define interoperability: How do plugins work together?
- Specify testing and distribution: How are plugins published?
This RFC does not mandate specific implementation languages (Rust, Python, WebAssembly all possible).
This RFC does not create a plugin marketplace in the MVP (future).
This RFC does not specify UI plugin extensions (focus on backend).
This RFC does not address plugin dependency management beyond basic versioning.
┌─────────────────────────────────────┐
│ Aidos Core Runtime │
│ (Projects, Sessions, Tool Broker) │
└────────────────┬────────────────────┘
│
Plugin Broker (Manager)
│
┌───────────┼───────────┐
↓ ↓ ↓
[Plugin A] [Plugin B] [Plugin C]
(isolated) (isolated) (isolated)
Plugins are loaded by Plugin Broker, which:
- Discovers plugins (filesystem, registry)
- Validates and sandboxes them
- Enforces permissions
- Provides plugin API
- Handles lifecycle
Knowledge Plugin:
Extend Knowledge Engine (RFC-0015) with new sources.
Interface:
query(index_type: String, query: String) -> List<Result>
index(project_id: UUID, batch: List<Document>)
Example: SQL database knowledge source
query("sql", "SELECT * FROM users WHERE...")
index("sql", [row1, row2, ...])
Model Plugin:
Provide custom AI models.
Interface:
list_models() -> List<ModelInfo>
invoke(model_id: String, request: ModelRequest) -> ModelResponse
Example: Specialized code generation model
invoke("specialized-codegen", {
prompt: "Generate Rust function for...",
context: { language: "rust" }
})
Tool Plugin:
Extend Tool Broker (RFC-0030) with new tools.
Interface:
list_capabilities() -> List<Capability>
invoke(capability_id: String, request: ToolRequest) -> ToolResult
Example: Slack integration tool
invoke("slack:send", {
channel: "#alerts",
message: "Analysis complete"
})
Instruction Plugin:
Provide domain-specific instructions.
Interface:
list_instructions() -> List<Instruction>
get_instruction(id: String) -> Instruction
Example: Python best practices
get_instruction("python-style")
→ Returns PEP 8 + project-specific rules
Media Plugin:
Handle custom file types.
Interface:
handles_type(mime_type: String) -> Boolean
render(file: File) -> RenderedOutput
extract_metadata(file: File) -> Metadata
Example: Scientific paper handler (.pdf, .arxiv)
render(paper.pdf) → Highlights, annotations, summary
Importer Plugin:
Import projects from external formats.
Interface:
supports_format(file_extension: String) -> Boolean
import(file: File, config: ImportConfig) -> Project
Example: GitHub projects importer
import("myrepo.zip") → Create Aidos project from GitHub export
Exporter Plugin:
Export projects to external formats.
Interface:
supports_format(format: String) -> Boolean
export(project: Project, config: ExportConfig) -> File
Example: Markdown documentation exporter
export(project) → Generate markdown docs from artifacts
Plugins are discovered from multiple sources:
Discovery paths:
1. Built-in plugins: /usr/lib/aidos/plugins/
2. User plugins: ~/.aidos/plugins/
3. Project plugins: .aidos/plugins/
4. Plugin registry: aidos.registry.io (future)
Plugin manifest (plugin.toml):
[plugin]
name = "slack-integration"
version = "1.0.0"
author = "Aidos Team"
description = "Send notifications to Slack"
[plugin.types]
tool = true
[plugin.capabilities]
permissions = ["network:https", "secrets:read"]
[plugin.dependencies]
aidos = "^0.1"
[plugin.entrypoint]
# Language-specific
script = "slack.py" # Python
binary = "slack-plugin" # Executable
wasm = "slack-plugin.wasm" # WebAssembly
Loading process:
On plugin discovery:
1. Read plugin.toml
2. Validate format version
3. Check dependencies (Aidos version, etc.)
4. Verify signature (if signed)
5. Create sandbox/process
6. Load plugin code
7. Call plugin init() hook
8. Register capabilities
9. Add to active plugins list
On plugin request:
1. Route request to plugin
2. Enforce capability checks
3. Call plugin method
4. Receive result
5. Log invocation
6. Return to caller
Plugins declare required capabilities:
Plugin capabilities:
- filesystem:read (read project files)
- filesystem:write (write project files)
- network:https (make HTTPS requests)
- secrets:read (access stored credentials)
- models:invoke (call AI models)
- git:read (read Git history)
- git:write (create commits)
User approval:
On first use, prompt:
"Plugin 'slack' wants to:
- Make HTTPS requests
- Read credentials
[Allow] [Deny] [Always allow]"
Runtime enforcement:
If plugin tries filesystem:write without capability:
→ PermissionError (operation blocked)
Installation to removal:
Install:
1. Download plugin package
2. Verify signature
3. Validate dependencies
4. Extract to plugin directory
5. Initialize on next restart
Activate:
1. Load plugin code
2. Call plugin.on_activate()
3. Register capabilities
4. Subscribe to events if needed
5. Report activation status
Deactivate:
1. Call plugin.on_deactivate()
2. Unregister capabilities
3. Close connections
4. Unload code
Remove:
1. Deactivate plugin
2. Delete plugin directory
3. Remove from plugin registry
All plugins expose common interface:
Plugin Interface:
on_init() → Result
Called when plugin loads
on_activate() → Result
Called when explicitly activated
on_deactivate() → Result
Called when deactivating
on_destroy() → Result
Called before unload
get_metadata() → PluginMetadata
Return plugin info
get_capabilities() → List<Capability>
List what plugin can do
handle_request(
capability_id: String,
request: Request
) -> Result
Route requests to plugin
Plugins can be configured:
Project config: .aidos/config.toml
[[plugins]]
name = "slack-integration"
enabled = true
config = {
workspace = "my-workspace",
token_secret = "slack-token",
channels = ["#alerts", "#updates"]
}
[[plugins]]
name = "sql-knowledge"
enabled = true
config = {
connection_string = "secret:db-connection"
}
Plugins can communicate via events:
Plugin A publishes event:
EventBus.publish("my-event", {
data: "something",
timestamp: now()
})
Plugin B subscribes:
EventBus.subscribe("my-event", |event| {
handle_event(event)
})
Constraints:
- Events scoped to project
- Subscriptions need capability
- Unsubscribe on deactivate
Plugins must be tested:
Testing:
1. Unit tests (standard practice)
2. Integration tests with mock Aidos API
3. Sandbox validation (permission checks)
4. Manual testing in dev environment
Distribution:
1. Source: GitHub (self-hosting)
2. Package: .aidos-plugin zip archive
3. Registry: Submit to aidos.registry.io (future)
4. Signing: Optional GPG signature
5. Verification: Users verify before install
Example plugin package:
slack-plugin.aidos-plugin
├── plugin.toml
├── slack.py (or slack-binary)
├── README.md
├── LICENSE
└── tests/
Plugin API versioning:
Semver versioning:
MAJOR.MINOR.PATCH
MAJOR: Breaking API change
Plugins must be updated/recompiled
MINOR: New features, backward compatible
Existing plugins continue working
PATCH: Bug fixes
No compatibility issues
Aidos core declares API version:
aidos_api_version = "1.0"
Plugin declares compatibility:
aidos = "^1.0" (any 1.x version)
aidos = "~1.2" (1.2.x only)
Migration path:
1. Core released with deprecation notice
2. Plugins have 1 major version to update
3. Deprecated API removed in next major
PluginBroker {
plugins: Map<PluginId, Plugin>
registry: PluginRegistry
active_plugins: List<PluginId>
plugin_processes: Map<PluginId, Process>
event_bus: EventBus
}
Plugin {
id: String
name: String
version: String
manifest: PluginManifest
config: Map<String, Any>
capabilities: List<Capability>
status: String # "loaded", "active", "error"
process: Process?
}
PluginManifest {
format_version: String
name: String
version: String
author: String
description: String
plugin_types: List<String> # "tool", "knowledge", "model", etc.
capabilities: List<String> # Permissions needed
dependencies: Map<String, String>
entrypoint: EntryPoint
}
EntryPoint {
script: String? # Python/JavaScript path
binary: String? # Executable path
wasm: String? # WebAssembly module
}
Plugin security is critical:
- Sandboxing: Plugins run in isolated processes (preferred) or namespaced environments.
- Capability enforcement: All operations checked against declared permissions.
- Resource limits: CPU, memory, disk usage quotas.
- Network isolation: Plugins cannot access network except declared in manifest.
- Filesystem isolation: Plugins cannot access filesystem except project directory.
- Signature verification: Optional GPG signing for trusted sources.
- Audit logging: All plugin operations logged.
- Review before install: Users aware of permissions before activating.
MVP includes:
- Plugin loading: Discover, load, unload plugins.
- Tool plugins: Extend Tool Broker with new tools.
- Capability enforcement: Permission checks on all operations.
- Basic plugin types: Tool, Knowledge, Model (at least 1-2).
- Configuration: Plugin config files.
- Lifecycle: Install, activate, deactivate, remove.
- Event bus: Plugins communicate via events.
- Documentation: Plugin development guide.
Not included:
- Plugin marketplace (future).
- UI plugins (future).
- Plugin dependency resolution (future).
- Hot reload (future).
- Plugin auto-update (future).
- Cloud-hosted plugins (future).
Curated registry of plugins:
Aidos Plugin Registry (aidos.registry.io):
- Browse plugins by category
- Search and discovery
- Ratings and reviews
- One-click install
- Version management
- Auto-update capabilities
Update plugins without restart:
Hot reload flow:
1. User uploads new plugin version
2. Broker deactivates old version
3. Loads new code
4. Activates new version
5. Existing requests complete gracefully
Manage plugin-to-plugin dependencies:
Plugin A depends on Plugin B:
dependencies = { "plugin-b" = "^1.0" }
On install:
1. Check if Plugin B installed
2. If not, offer to install
3. Verify version compatibility
4. Both load in order
Extend desktop and mobile UIs:
UI plugin types:
- Custom views (dashboards, inspectors)
- Context menu items
- Command palette commands
- Keyboard shortcuts
- Custom renderers for media types
Monitor plugin performance:
Metrics:
- Execution time per capability
- Memory usage
- Network requests
- Error rates
Analytics:
aidos plugin stats --json
→ CPU, memory, latency, error count
Alerts:
- Slow plugins (> 1s execution)
- High memory (> 100MB)
- Error spikes
- Should plugins be required to run in separate processes? (vs. library/in-process)
- Should plugin marketplace be curated or open?
- How should we handle plugin conflicts (two providing same capability)?
- Should users be able to write plugins in any language? (Or only approved ones)
- How should plugin updates be handled (manual or automatic)?
- Should plugins have quota limits? (E.g., max 1 million API calls/month)
- Should there be a plugin review process (security/quality)?
- Should plugins be able to store data in project storage?
files: []