Reconstruct the Discovery Chain
Explain index-first, filesystem fallback, manifest parsing, and source precedence.
A catalog can surface plugins, an installer can copy or clone them, and the runtime still needs to evaluate enabled status and trust. Only by separating these three layers can you see the real security boundaries of a plugin ecosystem.
Explain index-first, filesystem fallback, manifest parsing, and source precedence.
Distinguish between discoverable, installed, enabled, and trusted — avoid collapsing everything into a single "installed" semantic.
Determine how skills, agents, hooks, MCP, and scripts are handled differently when a plugin is not trusted.
marketplace-root/
├── .grok-plugin/
│ ├── marketplace.json
│ └── plugin-index.json
├── plugins/
│ └── sample-plugin/
└── default-skills/Scanner reads the index first; if missing or invalid, it falls back to scanning plugins/*/. default-skills can be added as a virtual plugin in the results.
sample-plugin/
├── plugin.json
├── skills/*/SKILL.md
├── commands/
├── agents/
├── hooks/hooks.json
├── .mcp.json
└── scripts/plugin.json is the preferred manifest; .grok-plugin/plugin.json and .claude-plugin/plugin.json are fallback locations. PluginManifest can override paths for skills, commands, agents, hooks, MCP, and LSP; after parsing, paths are validated to remain within the plugin root.
--plugin-dir.grok/plugins$GROK_HOME/plugins[plugins].pathsKey distinction: xai-grok-plugin-marketplace handles catalog, scanning, and installation; xai-grok-agent::plugins handles runtime discovery, deduplication, name conflicts, enabling, and trust. A record appearing in Marketplace does not mean the component is immediately executable.
MarketplaceRelativePath rejects absolute paths, parent-directory traversal, and out-of-bounds joins. Remote entries can be pinned by git ref or SHA.
Discovery config maintains enabled and disabled lists. Project- or user-scoped entries default to the disabled list; CLI override and config-path entries default to enabled. Users can adjust explicitly.
Project plugins are authorized by canonical plugin root at single-plugin granularity. Trust records are written to ~/.grok/trusted-plugins.
match dunce::canonicalize(plugin_root) {
Ok(path) => self.trusted.contains(&path),
Err(_) => false,
}CLI override and user scope are marked trusted in the source; project scope requires explicit trust. Config paths under the user home may be auto-trusted; other locations still require authorization.
crates/codegen/xai-grok-agent/src/plugins/trust.rs · discovery.rsLocal Marketplace installs via managed install storage; remote entries are located via Git URL, ref, SHA, and subdir. InstallRegistry writes a MarketplaceProvenance.
The current code can prove the official source constant, multiple sources, catalog indexing, search, and install flow. It cannot prove plugin count, active authors, audit coverage, or growth rate — this page makes no such inferences.
xai-grok-plugin-marketplace/src/lib.rs · types.rsDeliverable
Plugin skeleton and threat table
The core value of a plugin system is shaped equally by its capability surface and its trust surface. The catalog solves discovery, the installer handles persistence, and the runtime trust gate decides which components enter the execution chain.
Source snapshot note: This page is based on the local grok-build-main repository's xai-grok-plugin-marketplace and xai-grok-agent::plugins. The directory tree merges source-code defaults for teaching clarity; source precedence, path constraints, enable config, and trust behavior follow source semantics.