Part 6 · Inside a Production Coding Agent

Plugin Marketplace: Discovery & Trust

Distinguishing catalog, installation, runtime discovery, enablement state, and plugin root trust

THE QUESTION THIS PAGE ANSWERS

ANSWER FIRST

What is the key idea behind “Plugin Marketplace: Discovery & Trust”?

Distinguishing catalog, installation, runtime discovery, enablement state, and plugin root trust

DECISION RULE

Make the claim earn its place. Use this page as a decision aid, not a definition to memorize. Connect the idea to one real task, one observable result, and one failure that would change your mind.

TRY NEXT

Write one question you could answer with evidence after trying this idea.

WATCH FOR

A conclusion that sounds complete but leaves the key assumption untested.

Grok Build Source Course · 12 / 21

Marketplace:Discovery, Installation, and Execution Layers

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.

Indexed + FallbackManifestInstall RegistryPer Plugin Root Trust
01 / OBJECTIVES

Lesson Objectives

Reconstruct the Discovery Chain

Explain index-first, filesystem fallback, manifest parsing, and source precedence.

Separate Four States

Distinguish between discoverable, installed, enabled, and trusted — avoid collapsing everything into a single "installed" semantic.

Draw the Execution Boundary

Determine how skills, agents, hooks, MCP, and scripts are handled differently when a plugin is not trusted.

02 / CORE VISUAL

From Catalog to Runtime

03 / STRUCTURE

Real Structure of a Marketplace and Plugin

MARKETPLACE

Catalog answers "what's available"

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.

xai-grok-plugin-marketplace/src/scanner.rs · index.rs · catalog.rs
PLUGIN

Plugin answers "what's inside"

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.

xai-grok-agent/src/plugins/manifest.rs · docs/hooks-and-plugins.md
04 / DISCOVERY

Two Discovery Chains, Each with Its Own Role

CLI override--plugin-dir
Highest source priority
Project.grok/plugins
Compatible with .claude
User$GROK_HOME/plugins
Installed plugins
Registrymarketplace provenance
git / local source
Config path[plugins].paths
Location affects trust

Key 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.

05 / THREE GATES

Three Gates from Visible to Executable

1

Source and Path

MarketplaceRelativePath rejects absolute paths, parent-directory traversal, and out-of-bounds joins. Remote entries can be pinned by git ref or SHA.

2

Enabled State

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.

3

Execution Trust

Project plugins are authorized by canonical plugin root at single-plugin granularity. Trust records are written to ~/.grok/trusted-plugins.

06 / TRUST

Component Matrix for Untrusted Plugins

Component
Discovery
Execution When Untrusted
Skills / Agents
Metadata listable
Metadata-level discovery only
Hooks
Identifiable from manifest
Load and execution blocked
MCP Servers
Identifiable from config path
Command startup blocked
Scripts
Part of plugin content
Execution blocked
FAIL CLOSED

Path resolution failure treated as untrusted

match dunce::canonicalize(plugin_root) {
    Ok(path) => self.trusted.contains(&path),
    Err(_) => false,
}
TRUST SCOPE

Source affects initial trust determination

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.rs
07 / SOURCE

Installer Preserves Provenance; Catalog Makes No Scale Guarantees

PROVENANCE

Install records are traceable

Local Marketplace installs via managed install storage; remote entries are located via Git URL, ref, SHA, and subdir. InstallRegistry writes a MarketplaceProvenance.

xai-grok-plugin-marketplace/src/installer.rs
EVIDENCE LIMIT

Source proves the mechanism, not the ecosystem scale

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.rs
08 / LAB

Lab: Build a Threat Model for a Plugin

35 MIN

Deliverable
Plugin skeleton and threat table

  1. Create a minimal plugin directory with a skill, hook, and MCP config; write the manifest.
  2. Create a Marketplace index entry and explain how the filesystem fallback works when the index is missing.
  3. List the four states — discoverable, installed, enabled, trusted — and diagram the allowed transitions.
  4. Design three attacks: path traversal, malicious project hook, same-name plugin hijacking; find the source-level guardrails for each.
  5. Identify one remaining risk and propose a solution: pre-install review, SHA pinning, or least privilege.
Takeaway

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.

Why “Marketplace: Discovery, Installation, and Execution Layers” depends on the operation

“A catalog can surface plugins, an installer can copy or clone them, and the runtime still needs to evaluate enabled status and trust.” makes the structure concrete. The useful comparison is not which name sounds more advanced, but how the data is arranged and how far the most common operation has to travel.

Read a structure through access and change

“Explain index-first, filesystem fallback, manifest parsing, and source precedence” exposes a trade-off that is easy to miss: reading by position, looking up by key, adding at either end, inserting in the middle, and traversing relationships do not favor the same organization. A structure that is fast for one operation is not automatically fast for all of them.

  • Create a minimal plugin directory with a skill, hook, and MCP config; write the manifest
  • Create a Marketplace index entry and explain how the filesystem fallback works when the index is missing
  • List the four states — discoverable, installed, enabled, trusted — and diagram the allowed transitions

Count scale and update frequency together

Use “The core value of a plugin system is shaped equally by its capability surface and its trust surface.” as a boundary check. Write down the data size, the dominant operation, and the latency you can accept before deciding whether an AI-generated structure actually fits.

From “Marketplace: Discovery, Installation, and Execution Layers” to “Reconstruct the Discovery Chain”

“Marketplace: Discovery, Installation, and Execution Layers” grounds the problem in “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 boundari…”. “Reconstruct the Discovery Chain” then moves it toward “Explain index-first, filesystem fallback, manifest parsing, and source precedence”. Together, they show that the lesson is not just a conclusion to remember, but a claim with conditions.

Carry the judgment into the next situation

When you meet a new data structure, do not begin by memorizing its definition. Write down the most frequent operation, estimate scale and update behavior, and check whether the structure satisfies all three conditions.

  • “Marketplace: Discovery, Installation, and Execution Layers”: 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 boundari…
  • “Reconstruct the Discovery Chain”: Explain index-first, filesystem fallback, manifest parsing, and source precedence
  • “The closing point”: Identify one remaining risk and propose a solution: pre-install review, SHA pinning, or least privilege

The final “The closing point” brings the discussion to “Identify one remaining risk and propose a solution: pre-install review, SHA pinning, or least privilege”. The useful thing to carry forward is knowing which judgments must be revisited when input, scale, or risk changes.

Mark as learned Your reading progress updates automatically
← PreviousNext →

Keep reading

The next useful article in the thread.

ARTICLE DISCUSSION

Leave one useful thought here.

Keep the idea that clicked, the question that stayed open, or a small note for the next learner.

Discussing Plugin Marketplace: Discovery & Trust Inside a Production Coding Agent
3discussionsArticle discussion · synced with the Circle
View in the learning circle
AM
Asha MorganContent editor
INSIGHTField note

I turned one judgment from this article into a small experiment I could run today. Knowing what to observe next is more useful than simply remembering the conclusion.

ARTICLE DISCUSSION7 helpful
LH
Lin HarperIndie developer
INSIGHTInsight

After reading this, I first looked for the conditions behind the idea instead of copying the method into a project. That order made the later trade-offs much clearer.

ARTICLE DISCUSSION5 helpful
KM
Kiki MooreProduct operations
QUESTIONQuestion

When this judgment reaches real work, which constraint should be added first? I am curious which step matters most between reading and the first practical attempt.

ARTICLE DISCUSSION4 helpful