Plugin Security¶
Understanding the security implications of Inkwell's plugin system.
Trust Model¶
Inkwell uses Python's entry point mechanism for plugin discovery. This means:
-
Any installed package can register plugins - When you install a Python package that declares Inkwell entry points, its plugins are automatically discovered and loaded.
-
Plugins run with full privileges - Plugin code executes with the same permissions as the Inkwell process itself. There is no sandboxing.
-
Automatic loading - Plugins are loaded when Inkwell starts, without explicit user confirmation.
Security Implications¶
What This Means for Users¶
- Only install trusted packages - Before installing a package that provides Inkwell plugins, verify its source and reputation.
- Review what's installed - Use
inkwell plugins listto see all discovered plugins. - Disable untrusted plugins - Use
inkwell plugins disable <name>to prevent a plugin from loading.
Attack Vectors to Be Aware Of¶
A malicious actor could create a PyPI package (e.g., inkwell-awesome-transcriber) that:
- Registers itself as an Inkwell plugin
- Executes arbitrary code when loaded
- Accesses files, network, or credentials with your user permissions
This is not unique to Inkwell - it's inherent to Python's packaging ecosystem. The same risks apply to any Python package you install.
Current Mitigations¶
Inkwell provides several safeguards:
- Type validation: Plugins must be valid
InkwellPluginsubclasses - API version compatibility: Version checks prevent loading incompatible plugins
- Graceful degradation: Broken plugins are tracked and reported without crashing
- Disable mechanism: Users can disable plugins via
inkwell plugins disable <name>
Best Practices for Users¶
- Audit your plugins - Regularly run
inkwell plugins listto review installed plugins - Install from trusted sources - Prefer plugins from known authors or organizations
- Check package metadata - Review PyPI pages for project links, maintainer info, and download stats
- Use virtual environments - Isolate Inkwell installations to limit exposure
- Keep plugins updated - Security fixes are distributed through package updates
Best Practices for Plugin Authors¶
When developing plugins, follow these security principles:
- Principle of least privilege - Only request the permissions your plugin actually needs
- Minimize dependencies - Each dependency is a potential attack surface
- Audit dependencies - Use tools like
pip-auditto check for known vulnerabilities - Document behavior - Clearly explain what your plugin does, especially network access or file operations
- Handle secrets carefully - Never log API keys or sensitive configuration values
- Validate inputs - Don't trust data from external sources without validation
Future Improvements¶
The following security enhancements are being considered for future releases:
- Plugin signature verification
- Explicit opt-in for third-party plugins
- Capability-based permission system
- Plugin sandboxing for untrusted code
Reporting Security Issues¶
If you discover a security vulnerability in Inkwell or a plugin:
- Do not open a public GitHub issue
- Contact the maintainers directly
- Provide details about the vulnerability and steps to reproduce
For third-party plugins, contact the plugin author directly.