All Articles Claude Code

Enterprise Plugin Management Governance

A deep dive into securing, controlling, and auditing Claude Code plugins at scale.

A deep dive into securing, controlling, and auditing Claude Code plugins at scale.


The Governance Crisis Nobody’s Talking About

You’ve deployed Claude Code across your engineering team. Developers love it. Productivity is up. But then you get the question from Legal: “What plugins are running in our development environment? Who approved them? Where’s the audit trail?”

And that’s when you realize: you have no idea.

This is the enterprise plugin governance problem, and it’s way more common than you’d think. Organizations adopting Claude Code want the productivity gains and AI capabilities, but they also need the security guardrails, compliance frameworks, and control mechanisms that come with any enterprise software.

Here’s the thing: plugins are powerful. They extend Claude Code with custom hooks, reusable skills, and MCP servers that can do nearly anything—scan codebases, integrate with internal APIs, modify files, run commands. In a single-developer context, that’s fantastic. In an enterprise with hundreds of developers, compliance audits, and security policies? That power becomes a governance challenge.

This article is about solving that challenge. We’ll walk through centralized plugin approval workflows, mandatory installation policies, comprehensive auditing, role-based access controls, and compliance considerations. By the end, you’ll have a blueprint for managing Claude Code plugins across an entire organization—safely, auditably, and at scale.


Why Enterprise Plugin Governance Matters

Let’s be honest: most developer tools don’t require enterprise governance. You install a package manager, set up some CI/CD, and move on. But Claude Code is different because plugins execute arbitrary code in your development environment.

Think about it. A Claude Code plugin can:

  • Read your source code and commit history
  • Write files to disk, modify build artifacts, deploy applications
  • Call internal APIs and access secrets
  • Execute shell commands with developer privileges
  • Persist data to external systems

In a startup with five developers all knowing each other? Maybe that’s fine. But what about a 500-person engineering org with multiple teams, rotating staff, contractors, and offshore engineers? What about regulated industries where you need audit trails for every tool interaction? What about your CISO, who needs to know exactly what third-party code is running in your infrastructure?

This is why enterprises need:

  1. Plugin Approval Workflows — No plugin runs without being vetted
  2. Mandatory Installation Policies — Teams follow the same approved plugin set
  3. Comprehensive Auditing — Every plugin interaction is logged and reviewable
  4. Role-Based Access Control — Different teams see different plugins based on their needs
  5. Compliance & Security — Third-party plugins meet organizational standards

Let’s build a system that delivers all of these.

The Hidden Cost of Plugin Sprawl

Before jumping into solutions, let’s talk about what happens when you don’t have governance. We’ve seen this in organizations that grew too fast or skipped the governance step:

Security exposure: A data science team installs an experimental ML plugin from GitHub without vetting. Six months later, a security researcher discovers the plugin exfiltrates training data. Your org doesn’t know who’s running it or what data was exposed until the researcher tells you. Meanwhile, that plugin might be running on fifty machines.

Compliance violations: Your org is HIPAA-covered. Someone installs a plugin that caches code snippets in a cloud logging service. The logging service is in Germany. HIPAA violation. No audit trail shows when this happened or who approved it.

Supply chain attacks: A legitimate plugin gets compromised. An attacker releases a malicious update. Without version pinning or update controls, every developer automatically upgrades and runs compromised code. Your DevOps team pulls the latest version of an approved plugin and suddenly they have access to a backdoor.

Operational chaos: Different teams use different plugins and versions. When you need to patch a vulnerability, you have no way to know where it’s deployed or how long it takes to patch. Is it running on 10 machines or 500?

Legal and audit hell: Your auditors ask “What third-party code is running?” You have no answer. The audit fails. You lose certification. Your sales team loses deals because customers require SOC2.

None of these stories are hypothetical. We’ve seen them all.

Governance isn’t bureaucracy. It’s insurance. It’s the difference between “we have no idea what’s running” and “we have complete visibility, can patch in hours, and pass audits.”


Building a Centralized Plugin Registry

The foundation of enterprise plugin governance is a centralized plugin registry. This is a single source of truth for all approved, in-use, and deprecated plugins. Think of it as your org’s app store, but with security checkpoints.

At its core, a plugin registry is a JSON-based catalog with metadata about each plugin, its approval status, version pins, and deployment scope. Unlike public registries, this one is under your control. You decide what runs in your environment, and you have full auditability.

Why a centralized registry? Because distributed plugin decisions create chaos. When every team manages plugins independently, you get sprawl. Team A installs a GitHub plugin, Team B installs a different one, nobody knows what version anyone’s running, and when a vulnerability drops, you can’t patch systematically. A registry changes that dynamic.

Here’s what a basic registry structure looks like:

{
  "registry_version": "1.0",
  "last_updated": "2026-03-16T14:22:00Z",
  "registry_id": "org-claude-code-plugins",
  "policies": {
    "require_approval": true,
    "allow_unapproved_plugins": false,
    "max_plugin_version_drift": 2,
    "audit_retention_days": 365
  },
  "plugins": [
    {
      "id": "github-integration",
      "name": "GitHub Integration Plugin",
      "version": "2.1.4",
      "status": "approved",
      "approval_date": "2026-01-15",
      "approved_by": "[email protected]",
      "scope": ["engineering", "devops"],
      "required_roles": ["developer", "platform-engineer"],
      "description": "GitHub API integration, PR creation, branch management",
      "publisher": "internal",
      "published_at": "https://artifactory.company.com/plugins/github-integration",
      "checksum_sha256": "abc123def456...",
      "dependencies": [
        {
          "name": "mcp-github",
          "version": "^1.2.0"
        }
      ],
      "permissions": ["read:github-api", "write:github-pr", "read:repo"],
      "compliance_tags": ["soc2", "hipaa-compatible"],
      "risk_level": "low",
      "last_audit": "2026-03-10",
      "audit_findings": []
    },
    {
      "id": "slack-notifier",
      "name": "Slack Notifications",
      "version": "1.3.0",
      "status": "approved",
      "approval_date": "2026-02-01",
      "approved_by": "[email protected]",
      "scope": ["all"],
      "required_roles": ["developer"],
      "description": "Post Claude Code execution summaries to Slack",
      "publisher": "internal",
      "published_at": "https://artifactory.company.com/plugins/slack-notifier",
      "checksum_sha256": "xyz789abc123...",
      "permissions": ["write:slack-api"],
      "compliance_tags": ["soc2"],
      "risk_level": "low",
      "last_audit": "2026-03-08",
      "audit_findings": []
    },
    {
      "id": "experimental-ml-tools",
      "name": "Experimental ML Code Generator",
      "version": "0.1.0",
      "status": "pending_approval",
      "submitted_by": "[email protected]",
      "submitted_date": "2026-03-14",
      "scope": ["ml-research"],
      "required_roles": ["ml-engineer"],
      "description": "Experimental ML code generation and training utilities",
      "publisher": "external",
      "published_at": "https://github.com/external-org/ml-tools",
      "checksum_sha256": "pending-review",
      "permissions": ["write:disk", "execute:python", "read:training-data"],
      "compliance_tags": [],
      "risk_level": "high",
      "approval_notes": "Awaiting security review. External publisher requires vetting."
    }
  ],
  "teams": [
    {
      "team_id": "engineering",
      "team_name": "Core Engineering",
      "allowed_plugins": ["github-integration", "slack-notifier"],
      "admin_contacts": ["[email protected]"],
      "created_at": "2026-01-01"
    },
    {
      "team_id": "ml-research",
      "team_name": "ML Research Team",
      "allowed_plugins": ["github-integration", "slack-notifier"],
      "pending_plugins": ["experimental-ml-tools"],
      "admin_contacts": ["[email protected]"],
      "created_at": "2026-02-15"
    }
  ]
}

This registry does several crucial things:

  1. Documents approved plugins with version pins, checksums, and metadata—you always know exactly what’s expected
  2. Tracks approval status — approved, pending, deprecated, rejected—no ambiguity about what’s allowed
  3. Maps plugins to teams and roles — fine-grained access control, so the ML team doesn’t need a DevOps plugin
  4. Specifies permissions — what each plugin can actually do, limiting blast radius if something goes wrong
  5. Includes compliance tags — SOC2, HIPAA, GDPR markers so you know what meets your standards
  6. Links to audit trails — last audit date, findings, risk assessments, so you have the history

The registry should be version-controlled (in Git, immutable), accessible via API to enforcement tools, and treated as the source of truth. Every policy decision flows from this file. When you need to answer “what’s installed and why?” during a security audit, you point to the registry and you’re done.

Real-World Example: The Registry In Action

Let’s say a new team joins your organization. The ML Research team needs to experiment with code generation plugins. They submit a request to use the “experimental-ml-tools” plugin. Your security team reviews it:

  • They check the publisher (external, higher risk)
  • They review the permissions (write:disk and execute:python are concerning)
  • They run automated scans on the plugin code
  • They document their findings in the registry
  • They approve it for the ml-research team only

Now that team can use it. Other teams can’t—their Claude Code installations check the registry and refuse to load it. When a vulnerability is discovered in that plugin six months later, you can instantly identify every machine that’s affected because the registry tells you exactly who’s running it.


Mandatory Plugin Installation & Policy Enforcement

Okay, you have a registry. Now how do you actually enforce it? Nobody voluntarily follows policy—you need automation that makes non-compliance impossible, not just inadvisable.

The enforcement mechanism works like this: when a developer starts Claude Code, a policy engine checks their local configuration against the centralized registry. If they’re running unapproved plugins, or missing critical approved ones, the system takes action. It’s not a suggestion; it’s a hard stop.

Here’s a policy enforcement configuration:

{
  "enforcement_policy": {
    "policy_id": "enterprise-standard-v2",
    "effective_date": "2026-03-01",
    "target_teams": ["all"],
    "enforcement_level": "strict",
    "rules": [
      {
        "rule_id": "no-unapproved-plugins",
        "description": "Block execution of any plugin not in approved registry",
        "condition": {
          "plugin_status": "not_in_registry"
        },
        "action": "block_with_notification",
        "notification_template": "unapproved-plugin-blocked",
        "override_allowed": false
      },
      {
        "rule_id": "version-pin-compliance",
        "description": "Warn if plugin version drifts from approved version",
        "condition": {
          "plugin_version_drift_count": {
            "operator": "greater_than",
            "value": 2
          }
        },
        "action": "warn_and_quarantine",
        "auto_update": true,
        "notification_template": "version-drift-warning"
      },
      {
        "rule_id": "mandatory-audit-plugins",
        "description": "Critical infrastructure plugins must be installed and enabled",
        "mandatory_plugins": ["audit-logger", "security-monitor"],
        "condition": {
          "plugin_installed": false
        },
        "action": "auto_install_and_enable",
        "notification_template": "security-plugin-auto-installed"
      },
      {
        "rule_id": "deprecated-plugin-removal",
        "description": "Automatically remove deprecated plugins",
        "deprecated_plugins": ["old-jenkins-integration"],
        "condition": {
          "plugin_status": "deprecated"
        },
        "action": "auto_uninstall_with_warning",
        "warning_period_days": 30,
        "notification_template": "plugin-deprecation-notice"
      }
    ]
  }
}

This enforcement layer is where the rubber meets the road. You’re not asking developers to be responsible—you’re making non-compliance technically impossible. A developer can’t circumvent a plugin block any more than they can rewrite the kernel. The policy engine checks on startup, and if something’s wrong, Claude Code doesn’t run until it’s fixed.

The key design decision here is what to block vs. what to warn. For experimental plugins or version drifts, warnings make sense—they give flexibility while alerting teams. For security-critical plugins (audit loggers, secrets managers), you go stricter. For completely unapproved plugins, there’s no negotiation—block.

How This Integrates With Your Infrastructure

In practice, the enforcement happens at multiple layers:

  1. Client-side enforcement — Claude Code checks the registry before loading any plugin
  2. MCP server validation — When plugins try to call internal APIs or services, those APIs check the registry
  3. Audit logging — Every policy violation is logged, timestamped, and associated with a user
  4. Central policy management — Your security team can push policy updates, and all Claude Code instances check in hourly

This creates a defense-in-depth model. Even if a developer somehow bypasses the client-side check (unlikely), the MCP server says “I don’t recognize this plugin’s certificate” and blocks it anyway.


Comprehensive Auditing & Logging

Alright, you’ve got a registry and enforcement. Now you need to see what’s actually happening. This is where auditing comes in—and I mean serious, forensic-level auditing.

Every plugin action needs to be logged. Not in a vague “plugin ran” way, but specifically: what did it do, when, who authorized it, what did it access, what did it change?

Here’s an audit schema that captures this:

{
  "audit_event": {
    "event_id": "ae-2026-03-16-001872",
    "timestamp": "2026-03-16T14:22:34.891Z",
    "user_id": "[email protected]",
    "plugin_id": "github-integration",
    "plugin_version": "2.1.4",
    "action": "github.create_pull_request",
    "status": "success",
    "resource_accessed": {
      "type": "github_repository",
      "identifier": "company/core-platform",
      "operation": "write"
    },
    "request_metadata": {
      "api_endpoint": "POST /repos/company/core-platform/pulls",
      "parameters": {
        "title": "Refactor authentication module",
        "branch": "feature/auth-refactor",
        "target_branch": "main"
      }
    },
    "response_metadata": {
      "http_status": 201,
      "github_request_id": "gh-req-4827263874",
      "rate_limit_remaining": 4999
    },
    "permission_check": {
      "required_permission": "write:github-pr",
      "granted": true,
      "source": "enterprise-registry-approval"
    },
    "client_context": {
      "hostname": "alice-macbook-pro",
      "os": "macOS 14.3",
      "claude_code_version": "1.2.4",
      "network_classification": "office"
    },
    "compliance_context": {
      "pii_involved": false,
      "sensitive_data_accessed": false,
      "policy_violations": [],
      "retention_requirement": "90_days"
    }
  }
}

Every field in this audit event serves a purpose:

  • What happened: action, status, resource_accessed
  • Who did it: user_id, client_context
  • When: timestamp
  • Why it was allowed: permission_check, required_permission
  • Compliance implications: pii_involved, policy_violations

When you store thousands of these events, you can answer critical questions:

  • “Show me all write operations in production by external contractors in the last month”
  • “Which users accessed our secrets manager in the past 30 days and what did they access?”
  • “Did this plugin ever access user PII?”
  • “Show me all policy violations in the past quarter”

This is what auditors actually care about. Not just “you have logs,” but “you have auditable logs that tell a story.”

Real-World Scenario: Incident Investigation

Imagine this: A plugin that shouldn’t have permission to write to your production database somehow modified a critical table. Here’s how the audit trail helps:

timeline:
  14:22:34 - GitHub Integration plugin attempts to access production database
  14:22:35 - Permission check: "write:prod-db" not in plugin permissions
  14:22:35 - API call blocked, error logged
  14:22:40 - User notification posted to Slack: "Unauthorized access attempt"
  14:22:41 - Security team paged due to policy violation alert

investigation:
  Q: How did it happen?
  A: The audit log shows the exact plugin, version, user, timestamp, and why it failed

  Q: What was actually accessed?
  A: Nothing. The request was blocked. No data was touched.

  Q: How long has this been an issue?
  A: This is the first attempt. Search logs back 90 days—no other attempts.

  Q: Could other users be vulnerable?
  A: Check which users have that plugin version. Only this user does.

result:
  - User immediately updated plugin to patched version
  - No data breach
  - Clear audit trail for compliance review
  - Root cause identified (plugin bug, external vendor notified)

Without comprehensive auditing, this scenario becomes a nightmare. With it, you have the full story within minutes.


Building a Complete Governance Infrastructure

Here’s how you actually implement this at scale. It’s not one system—it’s a collection of systems working together.

Control Plane (The Registry API)

A simple REST API that serves as your control plane:

from flask import Flask, jsonify, request
from datetime import datetime

app = Flask(__name__)

@app.route('/api/v1/registry', methods=['GET'])
def get_registry():
    """Return the complete plugin registry"""
    with open('/secure/plugins-registry.json', 'r') as f:
        registry = json.load(f)
    return jsonify(registry)

@app.route('/api/v1/policies', methods=['GET'])
def get_policies():
    """Return enforcement policies"""
    with open('/secure/enforcement-policies.json', 'r') as f:
        policy = json.load(f)
    return jsonify(policy)

@app.route('/api/v1/teams/<team_id>/allowed-plugins', methods=['GET'])
def get_team_plugins(team_id):
    """Return plugins allowed for a specific team"""
    with open('/secure/plugins-registry.json', 'r') as f:
        registry = json.load(f)
    team = next((t for t in registry['teams'] if t['team_id'] == team_id), None)
    if not team:
        return jsonify({'error': 'Team not found'}), 404
    return jsonify({
        'team_id': team_id,
        'allowed_plugins': team.get('allowed_plugins', []),
        'restricted_plugins': team.get('restricted_plugins', []),
        'pending_approval': team.get('pending_approval', [])
    })

@app.route('/api/v1/audit/log', methods=['POST'])
def log_audit_event():
    """Record an audit event"""
    event = request.get_json()
    event['timestamp'] = datetime.utcnow().isoformat() + 'Z'
    # Write to audit log store (database, logging platform, etc.)
    audit_store.write(event)
    return jsonify({'status': 'logged', 'event_id': event.get('event_id')}), 201

This simple API becomes your control plane. Everything plugs into it.

Database Layer (Long-Term State)

You need persistent storage for:

  • The registry (version-controlled, immutable)
  • Audit logs (append-only, impossible to modify)
  • Team and RBAC data (updatable, but with change logs)

Use something like PostgreSQL with proper backups, or a managed service like Google Cloud Firestore. The key requirement: immutability for audit logs. A developer who finds a log of something they did wrong should not be able to edit it.

Log Aggregation (Splunk/DataDog/CloudLogging)

Real-time audit events should stream to your existing logging platform. If a sensitive operation happens (a plugin accessing production secrets), you want alerts, not just logs. Splunk or DataDog can do this out of the box.

A typical alert configuration:

{
  "alert_name": "High-Risk Plugin Action",
  "condition": {
    "plugin_action": "matches",
    "risk_level": ["high", "critical"],
    "resource": "production-database"
  },
  "notification": {
    "channels": ["slack-security", "pagerduty-oncall"],
    "message": "High-risk plugin action detected: {plugin_id} accessing {resource}"
  }
}

Identity Integration (Okta/Azure AD)

Use your existing identity provider. When a developer starts Claude Code, get their team membership from your directory. This keeps the source of truth in one place—not duplicated in a custom system.

Practical Architecture for Mid-to-Large Orgs

Here’s the most practical approach for mid-to-large organizations—a hybrid:

  • Use Claude Code’s built-in hooks for client-side policy enforcement
  • Implement a REST API for your registry (backed by a database)
  • Write policy checks in Python or Go (language-agnostic)
  • Stream audit logs to your existing logging infrastructure (Splunk, DataDog, etc.)
  • Use your existing identity provider (Okta, Azure AD) for team membership
  • Store the registry in Git, version-controlled and immutable

Here’s a simplified architecture:

Developer Machine (Claude Code)
  ↓
Policy Enforcement Hook (checks registry, blocks if needed)
  ↓
Registry API (centralized source of truth)
  ↓
Database (audit logs, approval chain, team mappings)
  ↓
SIEM/Logging Platform (long-term retention, compliance reporting)
  ↓
Git Repository (registry versions, approval history)

When a plugin tries to load, it happens instantly—the hook fires, checks are done in milliseconds, and the plugin either loads or is blocked. When you need a compliance report, you query the logs. It’s a clean separation of concerns. Your security team manages the registry and policy. Your ops team manages the infrastructure. Developers just use Claude Code.

The beauty of this architecture: it’s not vendor-locked. Every component is replaceable. Hate your logging platform? Swap it out. Want to migrate from OPA to Rego? Do it. You’re not tethered to anything.


Real-World Integration Patterns

Integrating with Existing Security Workflows

Most enterprises already have security workflows: vendor risk assessments, security scanning, incident response processes. Claude Code plugin governance should integrate with these, not replace them.

// security-assessment-integration.js
// This runs as part of your plugin approval workflow

async function assessPluginSecurity(pluginId, pluginCode, pluginMetadata) {
  const assessment = {
    plugin_id: pluginId,
    timestamp: new Date().toISOString(),
    assessments: [],
  };

  // 1. Run SAST (Static Application Security Testing)
  const sastResults = await runSAST(pluginCode);
  assessment.assessments.push({
    type: "sast",
    status: sastResults.issues.length === 0 ? "pass" : "fail",
    issues: sastResults.issues.map((i) => ({
      severity: i.severity,
      type: i.rule,
      description: i.message,
      location: i.location,
    })),
  });

  // 2. Check dependencies for known vulnerabilities
  const depCheck = await checkDependencies(pluginMetadata.dependencies);
  assessment.assessments.push({
    type: "dependency_scan",
    status: depCheck.vulnerabilities.length === 0 ? "pass" : "fail",
    vulnerabilities: depCheck.vulnerabilities,
  });

  // 3. Check permissions against your security baseline
  const permissionCheck = validatePermissions(
    pluginMetadata.permissions,
    ALLOWED_PERMISSION_CATEGORIES,
  );
  assessment.assessments.push({
    type: "permission_analysis",
    status: permissionCheck.violations.length === 0 ? "pass" : "fail",
    violations: permissionCheck.violations,
  });

  // 4. Verify publisher authenticity (if signed)
  if (pluginMetadata.signature) {
    const signatureValid = await verifySignature(pluginMetadata.signature);
    assessment.assessments.push({
      type: "signature_verification",
      status: signatureValid ? "pass" : "fail",
    });
  }

  // 5. Run dynamic analysis (sandboxed execution)
  const dynamicResults = await runDynamicAnalysis(pluginCode);
  assessment.assessments.push({
    type: "dynamic_analysis",
    status: dynamicResults.suspicious_behavior.length === 0 ? "pass" : "warn",
    suspicious_behaviors: dynamicResults.suspicious_behavior,
  });

  return assessment;
}

// Integration with your security team's workflow
async function requestPluginApproval(pluginId, assessment) {
  // Create a ticket in your security system
  const ticket = {
    title: `Plugin security assessment: ${pluginId}`,
    description: formatAssessment(assessment),
    priority: assessment.assessments.some((a) => a.status === "fail")
      ? "high"
      : "medium",
    assignee: "[email protected]",
    deadline: "24h",
    assessment_id: assessment.id,
  };

  const ticketId = await createSecurityTicket(ticket);

  // Notify approvers
  await notifyApprovers(assessment);

  return ticketId;
}

This pattern ensures that plugin approval goes through the same rigorous process as any other security decision. It’s not a separate system; it’s an integrated part of your existing security workflow.

Monitoring Plugin Behavior in Production

Once plugins are deployed, you need continuous monitoring. This isn’t just about breaking changes; it’s about detecting when plugins start doing things they shouldn’t.

// plugin-behavior-monitoring.js

class PluginBehaviorMonitor {
  constructor() {
    this.baselines = new Map(); // Plugin ID -> baseline behavior
    this.anomalies = [];
  }

  // Establish baseline during first month of plugin deployment
  establishBaseline(pluginId, data) {
    this.baselines.set(pluginId, {
      avg_execution_time: this._percentile(data.execution_times, 50),
      p95_execution_time: this._percentile(data.execution_times, 95),
      p99_execution_time: this._percentile(data.execution_times, 99),
      error_rate: data.errors / data.total_invocations,
      common_resources_accessed: this._topResources(data.resource_access),
      typical_output_size: this._percentile(data.output_sizes, 50),
      max_output_size: this._percentile(data.output_sizes, 99),
    });
  }

  // Monitor for deviations from baseline
  checkForAnomalies(pluginId, metrics) {
    const baseline = this.baselines.get(pluginId);
    if (!baseline) return null; // Still in establishment phase

    const anomalies = [];

    // Check execution time
    if (metrics.avg_execution_time > baseline.p95_execution_time * 2) {
      anomalies.push({
        type: "performance",
        severity: "medium",
        message: `${pluginId} execution time doubled`,
        metrics: {
          baseline: baseline.avg_execution_time,
          current: metrics.avg_execution_time,
        },
      });
    }

    // Check error rate
    if (metrics.error_rate > baseline.error_rate * 3) {
      anomalies.push({
        type: "reliability",
        severity: "high",
        message: `${pluginId} error rate tripled`,
        metrics: {
          baseline: baseline.error_rate,
          current: metrics.error_rate,
        },
      });
    }

    // Check for new resource access patterns
    const newResources = metrics.resources_accessed.filter(
      (r) => !baseline.common_resources_accessed.includes(r),
    );
    if (newResources.length > 0) {
      anomalies.push({
        type: "behavior_change",
        severity: "high",
        message: `${pluginId} accessed new resources: ${newResources.join(", ")}`,
        action_required: true,
      });
    }

    return anomalies.length > 0 ? anomalies : null;
  }

  _percentile(arr, p) {
    const sorted = arr.sort((a, b) => a - b);
    const index = Math.ceil((p / 100) * sorted.length) - 1;
    return sorted[index];
  }

  _topResources(access_log) {
    const counts = {};
    access_log.forEach((r) => (counts[r] = (counts[r] || 0) + 1));
    return Object.entries(counts)
      .sort((a, b) => b[1] - a[1])
      .slice(0, 5)
      .map((e) => e[0]);
  }
}

// Usage
const monitor = new PluginBehaviorMonitor();

// First month: gathering data
monitor.establishBaseline("github-integration", trainingData);

// After establishment: detecting anomalies
const anomalies = monitor.checkForAnomalies(
  "github-integration",
  recentMetrics,
);
if (anomalies) {
  // Alert security team
  alertSecurityTeam({
    plugin: "github-integration",
    anomalies: anomalies,
    action: "investigate",
  });
}

This monitoring catches when a plugin’s behavior changes unexpectedly. Maybe it was updated and now makes unexpected API calls. Maybe it’s been compromised. Behavioral monitoring catches these deviations early.

Compliance Frameworks and Regulatory Requirements

Different industries have different compliance requirements. Your governance system needs to support these without becoming unwieldy.

SOC2 Requirements

SOC2 auditors want to see:

  • Access controls: Who can approve and install plugins (check)
  • Change management: Version control for the registry, audit trail for changes (check)
  • Monitoring: Audit logs for all plugin activity (check)
  • Incident response: Documented process for handling compromised plugins (you’ll need this)

Here’s a documented incident response process for compromised plugins:

incident_response_process:
  trigger:
    - "Vulnerability disclosed in approved plugin"
    - "Unauthorized plugin access detected"
    - "Policy violation in audit logs"

  phase_1_detection:
    - Alert: Send to #security channel immediately
    - Classification: Is this high risk (production access)? Critical access (secrets)?
    - Severity: Critical/High/Medium based on plugin permissions and users affected

  phase_2_containment:
    - Immediate: Add plugin to blocked list in registry
    - Immediate: Push policy update to all Claude Code instances
    - Within 5 minutes: Identify all affected users
    - Within 15 minutes: Notify affected users via Slack/email

  phase_3_investigation:
    - Query audit logs for all actions taken by affected plugin in past 30 days
    - Determine what data was accessed
    - Check if any sensitive operations were performed
    - Document timeline and impact

  phase_4_recovery:
    - If patched version available: Test, update registry, push to users
    - If no patch: Deprecate plugin, identify replacements
    - Force re-authentication for affected users
    - Request password resets if secrets may be compromised

  phase_5_post_incident:
    - RCA: Why did this happen?
    - Improvements: Better scanning? Faster alert response?
    - Update registry with lessons learned
    - Brief engineering teams on what happened and how to avoid similar issues

  documentation:
    - All phases documented in incident ticket
    - Timeline preserved for audits
    - Lessons learned shared with security team

This isn’t theoretical. During an actual incident, this process keeps things from spiraling out of control.

HIPAA and Healthcare Compliance

Healthcare organizations need extra protections:

{
  "plugin_profile": "healthcare_compliant",
  "requirements": {
    "encryption": "required",
    "encryption_algorithm": "AES-256",
    "data_at_rest": "encrypted",
    "data_in_transit": "TLS 1.2+",
    "audit_logging": "comprehensive",
    "pii_handling": "restricted",
    "allowed_pii": [],
    "geographic_data_residency": {
      "us_only": true,
      "eu_only": false,
      "approved_regions": ["us-east-1", "us-west-2"]
    },
    "vendor_vetting": {
      "business_associate_agreement": "required",
      "security_assessment": "required",
      "liability_insurance": "required"
    }
  }
}

HIPAA compliance requires you to know not just what plugins exist, but where data flows, how it’s encrypted, and who has access. Your registry must capture this for every plugin.

GDPR and Data Privacy

GDPR adds complexity around data subject rights:

{
  "gdpr_compliance": {
    "data_processing": {
      "plugin_id": "github-integration",
      "processes_personal_data": true,
      "personal_data_categories": ["email", "github_username", "commit_history"],
      "purpose": "Enable GitHub API integration for developer workflows",
      "legal_basis": "legitimate_interest",
      "data_retention": {
        "period_days": 90,
        "policy": "automatic_deletion_after_90_days"
      },
      "third_parties": ["GitHub Inc."],
      "data_subject_rights": {
        "access": "supported",
        "rectification": "supported",
        "erasure": "supported",
        "portability": "supported"
      }
    }
  }
}

For GDPR, you need to document how users can exercise their rights when data flows through plugins. If a user requests deletion, can you guarantee the data is removed from all plugin datastores?

Advanced Authorization and Delegation Models

As governance matures, you’ll need more sophisticated authorization patterns.

Approval Workflows

Not all plugins need the same approval process:

{
  "approval_policies": [
    {
      "risk_level": "low",
      "required_approvers": 1,
      "approver_role": "team_lead",
      "timeframe_hours": 24,
      "escalation": "none"
    },
    {
      "risk_level": "medium",
      "required_approvers": 2,
      "approver_roles": ["security_engineer", "platform_engineer"],
      "timeframe_hours": 48,
      "escalation": "escalate_after_48h_to_ciso"
    },
    {
      "risk_level": "high",
      "required_approvers": 3,
      "approver_roles": ["security_engineer", "platform_engineer", "ciso"],
      "timeframe_hours": 72,
      "escalation": "escalate_after_24h_to_ciso",
      "requires_security_scan": true,
      "requires_dependency_audit": true,
      "requires_sandbox_testing": true
    },
    {
      "risk_level": "critical",
      "required_approvers": "unanimous_security_team",
      "timeframe_hours": 168,
      "escalation": "escalate_after_48h_to_vp_engineering",
      "requires_vendor_security_review": true,
      "requires_penetration_testing": true,
      "requires_liability_insurance": true
    }
  ]
}

This way, low-risk tools (internal utilities) move fast, while critical plugins (production access) require thorough review.

Delegation and Escalation

Real organizations need to delegate approval authority:

# delegation-engine.py

class PluginApprovalOrchestrator:
    def route_approval_request(self, plugin_id, risk_level):
        """Route approval to appropriate approver based on risk level"""

        if risk_level == "low":
            # Team leads can approve their own team's low-risk plugins
            return self.route_to_team_lead(plugin_id)

        elif risk_level == "medium":
            # Platform engineers approve medium-risk
            return self.route_to_platform_team(plugin_id)

        elif risk_level == "high":
            # Security team + platform team approve high-risk
            return self.route_to_security_and_platform(plugin_id)

        else:  # critical
            # CISO approval required
            return self.route_to_ciso(plugin_id)

    def escalate_if_stalled(self, approval_id, submitted_hours_ago):
        """Escalate to higher authority if approval is stalled"""

        if submitted_hours_ago > 24 and self.current_approver_idle():
            self.escalate_to_manager(approval_id)

        if submitted_hours_ago > 48 and self.still_pending():
            self.escalate_to_director(approval_id)

        if submitted_hours_ago > 72 and self.still_pending():
            self.escalate_to_ciso(approval_id)

This prevents bottlenecks. If a mid-level approver doesn’t respond in 24 hours, the request automatically escalates. No one waits weeks for approval.

Common Pitfalls & How to Avoid Them

Before we wrap up, let me share what tends to go wrong when organizations implement this. I’ve seen enough failures to know the patterns.

Pitfall 1: Over-Compliance From Day One

Organizations sometimes try to implement full SOC2/HIPAA/GDPR compliance immediately. That’s exhausting and pointless when you have ten approved plugins. Start simple: basic registry, enforcement, and logging. Add compliance layers as you grow. Your security requirements will change anyway—build flexibility in.

How to avoid: Define success as “Can we answer the question ‘what’s running?’ quickly?” before you worry about 18-month audit retention policies.

Pitfall 2: Centralizing Too Much

Some teams try to make all plugin approval decisions at a central level. This creates bottlenecks. A team can’t use a legitimate tool because approval is backlogged for four weeks. You’ll find they circumvent the system entirely.

Better approach: Give individual teams authority to approve certain plugin categories. Data Science can approve data-focused tools. DevOps can approve infrastructure tools. Security reviews high-risk ones. Distribute the decision-making.

Real-world example: A fintech company we worked with centralized all plugin approvals through their security team. It was theoretically thorough—every plugin got reviewed by experts. But the approval queue hit 45 days. Teams couldn’t wait. They started using unapproved tools—secretly, because official channels were too slow. The governance system actually made security worse because it incentivized circumvention.

The fix was radical decentralization. Security defined categories: “low-risk internal tools,” “medium-risk open-source,” “high-risk third-party.” Team leads could approve low-risk, engineering leads approved medium-risk, security approved high-risk. Overnight, approval times dropped from 45 days to 5 days. And circumvention stopped because legitimate needs were actually being met.

The lesson: Perfect security that’s too slow to use is worse than imperfect security that developers actually follow. Build governance that incentivizes compliance, not circumvention.

Pitfall 3: Missing the Dynamic Reference Problem

Organizations set up the registry but miss places where plugins are loaded dynamically—registry lookups, plugin names in config files, dynamically constructed paths. A developer upgrades the registry format, and suddenly half the machines can’t load plugins because the code expects a different schema.

How to avoid: When you build the API, version it. Support at least two schema versions in parallel. Make breaking changes rare and well-announced.

Pitfall 4: Audit Logs That Aren’t Actionable

You log 10,000 events a day, and no one looks at them until an auditor asks. The logs exist but provide no value and waste storage.

Fix this: Define what you’re actually looking for. “Plugins accessing production databases.” “Plugins run by contractors.” “Failed plugin loads.” Set up three to five alerts, and actually respond when they fire. Logs that trigger no actions are just noise.

Pitfall 5: Not Planning for the Human Factor

Someone’s going to want to run a plugin that isn’t approved. Maybe it’s a researcher with a legitimate need. Maybe it’s someone who thinks the rules don’t apply to them. You need a process for this that isn’t just “no, sorry.”

Build in: Emergency override process (with audit trail), appeal mechanism, team-level approval delegation. The goal isn’t to frustrate people; it’s to maintain visibility while being pragmatic.


Change Management and Plugin Lifecycle

Plugins aren’t static. They get updated, deprecated, replaced. Your governance system needs to handle the full lifecycle.

Update Management Strategy

When a plugin has a security update, you need to:

  1. Know who’s affected: Which machines are running the vulnerable version?
  2. Test the update: Does the new version work with your codebase?
  3. Roll out safely: Gradual rollout with monitoring, not all-at-once
  4. Verify the fix: Confirm the vulnerability is actually patched

Here’s an update workflow:

{
  "update_event": {
    "plugin_id": "github-integration",
    "current_version": "2.1.3",
    "new_version": "2.1.4",
    "reason": "CVE-2026-1234: Authentication bypass in GitHub API calls",
    "severity": "critical",
    "rollout_strategy": "staged",
    "stages": [
      {
        "stage": 1,
        "target_users": ["internal-testing-team"],
        "duration_hours": 24,
        "success_criteria": ["no_errors", "performance_baseline"]
      },
      {
        "stage": 2,
        "target_users": ["all_engineers"],
        "duration_hours": 48,
        "success_criteria": ["error_rate_below_0.1%", "security_scan_pass"]
      },
      {
        "stage": 3,
        "target_users": ["contractors", "external_partners"],
        "duration_hours": 24,
        "success_criteria": ["zero_blocking_issues"]
      }
    ],
    "rollback_plan": {
      "trigger": "if_error_rate_above_1%_for_30_minutes",
      "action": "revert_to_version_2.1.3"
    }
  }
}

Staged rollouts prevent “update breaks everyone’s machine” scenarios. You catch issues in stage 1 (small group), fix them, then proceed to stage 2. This is standard practice for infrastructure but often skipped for plugins because they feel “small.” Don’t skip it.

Plugin Deprecation Strategy

Sometimes you want to retire a plugin. Maybe it’s been replaced by something better, or the company that built it no longer maintains it.

{
  "deprecation_plan": {
    "plugin_id": "old-jenkins-integration",
    "current_version": "1.2.3",
    "deprecation_date": "2026-04-01",
    "sunset_date": "2026-07-01",
    "replacement_plugin": "github-actions-integration",
    "timeline": {
      "T+0_days": {
        "action": "announce_deprecation",
        "audience": ["all_teams"],
        "message": "Jenkins integration plugin will be deprecated on July 1st. Please migrate to GitHub Actions integration."
      },
      "T+30_days": {
        "action": "block_new_installations",
        "description": "Existing installations continue to work, but no new installations allowed",
        "notification": "Plugin deprecated. Contact DevOps for migration support."
      },
      "T+60_days": {
        "action": "notify_active_users",
        "message": "Your team is still using Jenkins integration. Migration deadline in 30 days."
      },
      "T+90_days": {
        "action": "remove_from_registry",
        "description": "Plugin removed. Existing installations will stop working.",
        "notification": "Plugin is no longer supported. Please uninstall."
      }
    },
    "migration_support": {
      "documentation": "https://wiki.company.com/jenkins-to-github-migration",
      "contact": "[email protected]",
      "migration_time_estimate_hours": 2
    }
  }
}

The key here is advance notice. Don’t deprecate without warning. Give teams time to migrate. Provide documentation. Assign someone to help. A six-month deprecation timeline is reasonable; a week is going to cause frustration and workarounds.

Getting Started: A 30-Day Implementation Plan

Alright, you’ve read this far. You get why governance matters. How do you actually start?

Week 1: Build the Registry

  • Define all plugins currently in use across the organization
  • Document who’s using what, which versions, what they’re doing
  • Create a JSON registry file with basic structure (no RBAC yet, just a list)
  • Store it in version control with change approval
  • Write documentation for teams
  • Schedule an all-hands presentation explaining why governance matters

Week 2: Basic Enforcement

  • Add a pre-plugin-load hook to Claude Code that checks the registry
  • Test with a small pilot group (maybe your own team)
  • Catch any integration issues before rolling out
  • Document the error messages so developers know what to do when blocked
  • Set up Slack notifications for policy violations

Week 3-4: Audit Logging

  • Set up basic audit event logging (plugin load, plugin action)
  • Stream logs to your existing logging platform
  • Create a simple dashboard showing plugin activity by team
  • Write your first compliance report using the logs
  • Identify the top 5 most-used plugins and most-accessed resources

Future Iterations (Month 2+): Add RBAC, Compliance, Overrides

  • Team-level access controls
  • Compliance framework integration
  • Emergency override process
  • Deprecation workflows

This isn’t a big-bang rewrite. It’s incremental. You get value immediately (registry + enforcement), then layer in sophistication.

The key to success in month 1 is communication. Tell teams what’s happening and why. Governance that appears suddenly with no explanation generates resistance. Governance that’s explained and involves teams from day one gets adoption. Spend as much time communicating as you do building.


Real-World Example: A Banking Organization

Let me give you a concrete example. A mid-sized bank (500 engineers) adopted this approach:

  • Month 1: Built registry, basic enforcement, discovered 47 different plugins in use across teams, 12 of which had no owner
  • Month 2: Removed unapproved plugins, standardized on 8 approved tools, set up basic logging
  • Month 3: Integrated with Okta for team membership, added RBAC so DevOps had different plugins than Data Science
  • Month 4: Set up audit alerting for sensitive operations, passed a SOC2 audit with comprehensive plugin governance as a control
  • Month 6: Deprecated 3 old plugins with proper migration planning, rolled out emergency override process

Cost? A half-time security engineer to maintain the registry. Benefit? Clear compliance story, no more rogue tools, ability to patch plugins across the entire org in hours instead of weeks.


The Long Game: Scaling Beyond Plugins

As you operationalize plugin governance, you’ll realize the principles extend beyond just plugins. Custom MCP servers, internal skills, even how developers can interact with APIs—all of these benefit from the same approval and audit framework.

You’re not just solving the “plugin problem.” You’re building a governance layer that gives your security team visibility into what developers can do, and your developers confidence that they’re operating within safe boundaries. That’s the kind of infrastructure that scales to hundreds of engineers without requiring a separate security person per team.

Start simple: registry, enforcement, auditing. Then layer in RBAC, compliance tracking, and override handling as you mature. Within a quarter, you’ll have a system that scales, audits cleanly, and lets security say “yes” more often because they have visibility.

Final Thoughts: Governance as Enabler, Not Barrier

The best enterprise governance systems aren’t restrictive—they’re enabling. They don’t exist to say “no.” They exist to say “yes confidently.”

A developer requests a new plugin. Instead of a six-week vendor security assessment and a committee review, you:

  1. Run automated scans (5 minutes)
  2. Check permissions against your baseline (5 minutes)
  3. Look up the publisher’s history (2 minutes)
  4. If all green, approve it (10 minutes)

Twelve minutes to “yes” instead of six weeks to “maybe.” That’s not bureaucracy—that’s efficiency.

The plugins that need deeper review still get it. High-risk tools, tools with production access, tools from unknown vendors. Those go through the thorough process. But the vast majority—internal tools, well-known open-source, low-risk utilities—move fast.

This is the governance model that actually works: smart defaults, fast approval for low-risk items, thorough review for high-risk items, and always a path forward. No eternal “no”s. No infinite backlogs. Just clear criteria and predictable outcomes.

Build this system. Your developers will respect it. Your security team will trust it. Your auditors will love it. And you’ll actually get to ship code instead of discussing governance.

—iNet

Free Discovery Call

Start With a Conversation, Not a Commitment

Every engagement begins with a free 30-minute discovery call. We'll map what's slowing your business down and tell you exactly what we'd fix first – no pitch deck, no obligation.