gitlab

How to govern agentic AI, MCPs, and AI code assistants (opens in new tab)

Agentic AI changes software governance because agents can independently modify code, call tools, alter CI/CD configurations, and deploy without line-by-line human review. The central control model must therefore focus on agent identity, permissions, data handling, human approval points, and auditable activity. Organizations should treat agents like privileged users, with consistent policies governing what they can access, which models they may use, and when humans must intervene.

Why Agentic AI Requires New Governance

  • Traditional code assistants keep humans involved in accepting or rejecting each suggestion.
  • Agentic systems can perform multi-step actions autonomously across the software delivery lifecycle.
  • Governance must answer:
    • What can the agent access?
    • What is it authorized to do?
    • What actions did it take, and can those actions be proven later?
  • Major organizational concerns include:
    • Distinguishing AI-generated code from human-written code.
    • Linking generated code to the business requirement or intent behind it.
    • Maintaining documentation as AI-generated code scales.
  • The article cites research showing widespread concern about maintainability, technical debt, and governance challenges.

Controlling Agents, MCPs, and Tools

Permissioning becomes especially important when agents use the Model Context Protocol (MCP) to connect to external tools and data.

  • A governance model should define:
    • Which agents and workflows are approved.
    • Where those agents may operate.
    • Which models they may use.
  • Recommended controls include:
    • Central agent catalog: Administrators publish and manage approved agents and flows.
    • Composite identity: Actions should be linked both to the agent and the human who initiated it.
    • Tool approval guardrails: Tools can run autonomously, require human approval, or be blocked.
    • Prompt guardrails: Systems should detect attempts to manipulate agents through untrusted webpages, files, or issue comments.
  • The objective is a role-based, auditable control plane for agents that is as consistent as existing human access management.

Data Privacy and Self-Hosted AI

Because source code is highly sensitive, organizations should establish clear data-handling policies before broad AI adoption.

  • Key questions include:
    • Whether the vendor trains models on company code.
    • Who owns prompts, inputs, and outputs.
    • Where subprocessors are located and how changes are communicated.
  • Self-hosted AI can keep agents and data within infrastructure controlled by the organization, which is particularly important for regulated industries.
  • Bring-your-own-model capabilities allow administrators to:
    • Use internally validated models.
    • Assign different models to specific agent workflows.
    • Reserve trusted models for sensitive operations while using managed models for lower-risk tasks.

Defining Human Review Boundaries

Governance should not eliminate autonomy; it should deliberately establish where autonomy ends.

  • Interactive workflows: Developers review and approve suggestions directly.
  • Headless workflows: Agents operate in CI/CD or other automated environments, requiring approval before sensitive actions or inspection afterward through audit trails.
  • Organizations should define approval requirements for:
    • Code review.
    • Testing and validation.
    • Deployment.
  • Enforcement mechanisms can include:
    • Merge request approval policies that apply equally to human- and agent-created changes.
    • Tool-level approval settings.
    • Scanner and pipeline controls that block changes failing security or quality checks.
  • An organization-wide AI governance policy is preferable to informal team-by-team practices because it promotes consistency and simplifies auditing.

Practical Recommendation

Treat agentic AI as a privileged software participant: give every agent a controlled identity, least-privilege permissions, approved model and tool access, strong privacy protections, and complete auditability. Keep human approval at security-sensitive decision points, while allowing lower-risk actions to proceed autonomously under enforced policies.