Skip to content
Field Academy
NEWNEW 18 min

Advanced agent configuration & MCP

The FDE-depth layer: rules, MCP, sandboxing, and matched guardrails.

0/6 sections

The FDE technical layer: configuration is the product

At enterprise scale the model is a commodity; the configuration is the differentiator. Anyone can install Cursor. The FDE earns their seat by turning a sharp tool into a governed, repeatable system: standards encoded once, context wired in safely, and execution power clamped to least privilege.

Think in three planes that every agent interaction passes through. Knowledge: what the agent knows about your standards (Project RulesVersion-controlled instructions in the repo that every Cursor agent interaction inherits, so standards are encoded once. / AGENTS.md). Context: what the agent can see outside the repo (MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs.). Capability: what the agent is allowed to do (command allow/blocklists, hooks, terminal sandboxing, isolation). Get those three right and autonomy becomes a dial you can turn with confidence instead of a leap of faith.

The thesis

An agent's behavior is the product of three configurable planes — knowledge, context, capability. The FDE's job is to make each one explicit, version-controlled, and auditable, so that 'the agent did something dumb/dangerous' becomes a config gap you can point to and close — not a vibe.

Say it like this

We don't 'trust the model.' We trust the controls around the model. Knowledge, context, and capability are each configured, scoped, and logged — so autonomy is something we earn with evidence, not something we hope for.

PlaneMechanismFailure if you skip it
KnowledgeProject RulesVersion-controlled instructions in the repo that every Cursor agent interaction inherits, so standards are encoded once. / AGENTS.mdAgent reinvents your conventions every prompt; PRs drift from house style
ContextMCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. servers + allowlistsAgent guesses about Jira/observability it can't see, or pulls from an ungoverned source
CapabilityAllow/blocklists, hooks, sandboxing, VM isolationAgent runs a destructive command or exfiltrates data; no blast-radius control

The three planes an FDE configures before talking about autonomy.

Self-check

Project Rules in depth: encode standards once

Project RulesVersion-controlled instructions in the repo that every Cursor agent interaction inherits, so standards are encoded once. are how you stop re-explaining your codebase to the model on every prompt. You write your style, test, and architecture standards once; they live in the repo, version-controlled, and every agent interaction in that scope inherits them automatically.

The mechanism: rules live under .cursor/rules/ (scoped, area-specific files) and the repo-root AGENTS.md (the open, portable convention for agent instructions). Because they are files in git, they get code review, blame, PR history, and rollback — the same lifecycle as any other source. That is the whole point: standards become an artifact, not tribal knowledge in someone's head or a Slack thread.

Scope rules to the area they governglobal vs. nested

Don't dump everything into one mega-rule. A root AGENTS.md carries org-wide invariants (language, security posture, 'never touch generated files'). Then nest area-specific rules next to the code they apply to — a stricter rule file in services/payments/ can demand 100% branch coverage and forbid new external calls, while web/ gets component conventions. The agent inherits the union, with the nearest scope winning. This is least-knowledge applied to standards: each subsystem teaches the agent exactly what it needs.

Good rule content

Concrete, testable directives: 'Use pytest, not unittest.'

Architecture boundaries: 'No direct DB access from controllers; go through the repository layer.'

Pointers to canonical examples in-repo the agent can imitate.

Rule smells

Vague vibes: 'Write clean code.'

Stale rules referencing deleted modules — review them like any code.

One 2,000-line file that applies everywhere and is mostly noise the model ignores.

Verified

BugbotCursor's automated PR reviewer that posts inline findings and can push fix commits from isolated VMs. reads repo-scoped review rules from .cursor/BUGBOT.md — the same file-in-git pattern. So the rules discipline isn't just for the coding agent; your reviewer agent inherits standards from version-controlled files too.

services/payments/.cursor/rules/payments.md — nested, area-scoped, version-controlled
# Payments service rules - All money is int cents; never float. - Every new endpoint requires a contract test + an idempotency key. - No new outbound network calls without an entry in ALLOWED_EGRESS.md. - Follow the repository pattern; controllers must not import the DB client. - Example to imitate: see charges/create_charge.py

Self-check

QMultiple choice: A team puts every standard for a 40-service monorepo into a single root AGENTS.md. What's the best critique?

MCP: governed context outside the repo

Most of what an engineer needs to do a task well lives outside the repo: the Jira ticket, the Confluence runbook, the Datadog dashboard showing the error spike, the internal API docs. MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. (Model Context Protocol) is the standard bridge that lets the agent reach that context — and the artifact graph is what it exposes through that bridge.

MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. is an open protocol: an MCP server wraps a system (Jira, Confluence, GitHub, an observability platform, an internal docs service) and exposes its data and actions as tools the agent can call. Instead of you copy-pasting a ticket into the chat, the agent queries the Jira MCP server directly, reads the acceptance criteria, and links the PR back. The repo stops being an island.

Why the FDE cares: context quality drives output quality

An agent that can see the ticket, the design doc, and the live error trace writes a fundamentally better fix than one guessing from the diff. MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. is the difference between 'autocomplete with extra steps' and 'a teammate who actually read the context.' But every server you connect is also a new trust boundary and a new data path — which is exactly why it must be governed.

Watch out

Every MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. server is both a context source AND an attack surface. A connected server can pull untrusted content into the model's context (prompt-injection vector) and can be a data-egress path. 'Connect everything' is how you turn a productivity feature into a data-exfiltration channel. Treat MCP servers like third-party integrations, because that's what they are.

Governing allowed MCP serversallowlists, not free-for-all

  • MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. allowlist — admins specify which MCP servers are permitted org-wide; developers can't wire in an arbitrary server that ships data to who-knows-where.
  • Scope per server — prefer read-only scopes for context-only servers (Confluence, docs); reserve write/action scopes (creating Jira tickets, posting to Slack) for servers that genuinely need them.
  • Privacy posture — remember Privacy ModeCursor's setting that routes requests under zero-data-retention terms so providers don't store or train on your code. + ZDRZero Data Retention. A contractual guarantee that the model provider won't store your code or train on it. govern what leaves to the model; an MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. server is a separate data path you must reason about independently.
  • AuditMCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. calls are part of the activity you want logged so you can answer 'what external systems did agents touch, and when?'
MCP server review checklist (FDE)
Who hosts it?
First-party / vendor / community — community servers get the most scrutiny.
Read or write?
Default to least scope; justify every write capability.
What data flows through?
Could it surface secrets, PIIPersonally Identifiable Information. Data that can identify a person (names, emails, SSNs); regulated and sensitive., or regulated data into context?
On the allowlist?
If not explicitly allowed by an admin, it's blocked. Allowlist is the control.

Run every proposed MCP server through this before it touches the org.

Self-check

Capability controls: least privilege for what an agent can do

Knowledge and context shape what the agent says. Capability controls govern what it can execute — and that's where blast radiusHow much breaks if a change goes wrong; the scope of potential damage. lives. The principle is the same one you'd apply to any service account: least privilege, deny by default, log everything.

The four capability controls

Command allow/blocklists

Specify which shell commands an agent may run. Allowlist npm test, git status, the linter; blocklist rm -rf, curl | sh, infra CLIs.

Deny-by-default for high-risk repos: nothing runs unless explicitly permitted.

Hooks

Programmatic interception points around agent actions — run a script before/after a tool call to validate, redact, gate, or log.

Use them to enforce policy you can't express as a simple allowlist (e.g., block writes to /infra, scan for secrets before commit).

Terminal sandboxing

Constrain the environment the agent's commands run in — limited filesystem, controlled egress — so an executed command can't roam the host.

Containment for the local execution surface.

VM isolation (Cloud Agents)

The strongest boundary: run the agent in an isolated cloud VM with scoped permissions, not on the developer's trusted laptop.

Compromise stays in a disposable box.

Verified

Cloud Agents (Cursor 3.5, May 2026) run in isolated VMs with terminal and browser, support parallel multi-repo and async execution. Autofix uses isolated cloud-VM agents and lands ~35% of its fixes merged. Isolation isn't theoretical — it's the production substrate for the higher-autonomy rungs.

Stack these, don't pick one. A mature setup uses allowlists to define the vocabulary of permitted actions, hooks to enforce policy on those actions, sandboxing to contain local execution, and VM isolation to contain autonomous/async execution. Each layer assumes the one above it can fail.

Interview answer

If asked 'how do you stop an agent from doing something destructive?' — name the layered model: allow/blocklist the command vocabulary, enforce policy with hooks, sandbox the terminal, and isolate autonomous runs in scoped VMs with audit logs. Then add: and we gate higher autonomy on evidence, so we're never relying on a single control.

Self-check

The agentic surface and matched guardrails per rung

There is no single 'agent.' There's a ladder of surfaces from near-zero autonomy to fully headless, and each rung needs guardrails matched to its blast radiusHow much breaks if a change goes wrong; the scope of potential damage.. The mistake teams make is applying laptop-grade trust to async, multi-repo execution — or, worse, starting at the top.

The autonomy ladder with matched guardrails
Tab-completeinline suggestionsIDE AgentPlan / Ask modeCLIplan/ask/debug · scriptableCloud Agentsisolated VMs · asyncSDK / headlessprogrammaticguardrails ↑
Tab-complete: Lowest autonomy. Useful everywhere, trivial guardrails.

Each rung up adds reach and removes a human from the loop — so each rung up must add controls. Higher autonomy is conditional on evidence + controls, never the start.

RungSurfaceHuman in loop?Matched guardrails
1Tab / inline completionEvery keystrokeRules; trivial blast radiusHow much breaks if a change goes wrong; the scope of potential damage.
2IDE agent — Ask / PlanReviews plan before actingRules + MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. read scopes; plan reviewed before execution
3CLI — plan / ask / debugDrives interactively in terminalCommand allowlist + terminal sandboxing; /debug (3.1, Apr 2026)
4Headless in CIPipeline gates, asyncLocked allowlist, hooks, scoped CI creds, required checks
5Cloud Agents — isolated VMsAsync, parallel multi-repoVM isolation, scoped permissions, audit logs, MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. allowlist
6SDK / fully headlessProgrammatic, no interactive humanAll of the above + deny-by-default, tight egress, mandatory review on merge

Surface → guardrail mapping. Verified surfaces: CLI /debug (3.1), Cloud Agents isolated VMs / parallel multi-repo / async (3.5).

Notice the inversion: as the human leaves the loop, the configuration has to carry the trust the human used to provide. At rung 1 a typo is nothing; at rung 6 a misconfigured egress rule is an incident. So guardrails don't stay constant up the ladder — they intensify in lockstep with reach.

Say it like this

Autonomy and control move together. Every rung that removes a human from the loop must add a control that takes their place — a tighter allowlist, a hook, an isolation boundary, a required review on merge. If reach goes up and controls stay flat, that's the gap I'd close first.

Self-check

QMultiple choice: Moving an agent from the IDE (Plan mode, human reviews each plan) to async Cloud Agents doing parallel multi-repo work. What MUST change about guardrails?

Prompt injection, untrusted content, and a SOX pilot config

Once an agent reads external content (a web page, a Jira comment, an MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs.-sourced doc), that content can contain instructions. Prompt injection is the agent equivalent of SQL injection: untrusted input smuggling commands into a privileged context. You defend by assuming any non-repo content is hostile and clamping what the agent can do with it.

Prompt-injection & untrusted-content defense

  • Treat fetched/MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. content as untrusted data, never as instructions — the model may read it, but capability controls decide what it can act on.
  • Least privilege limits the damage — even a successful injection can't rm -rf or exfiltrate if commands are blocklisted, egress is sandboxed, and the run is VM-isolated.
  • MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. allowlist shrinks the injection surface — fewer connected servers, fewer paths for hostile content to enter.
  • Hooks as a tripwire — scan for secret patterns before commit/egress; gate writes to sensitive paths.
  • Human review on merge — for anything regulated, a person signs off; the agent proposes, the human disposes.
Watch out

The dangerous combo is high capability + untrusted context + no human gate. An agent that can run arbitrary shell, reads an attacker-controlled web page via MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs., and auto-merges is a remote-code-execution path with extra steps. Break that chain at any link.

A concrete least-privilege pilot config for a SOX repodeny-by-default

SOXSarbanes-Oxley Act. A US law that forces companies to keep auditable controls over any system that affects their financial reporting. repos govern financial reporting controls — segregation of duties and change-evidence are non-negotiable. The agent can be a force multiplier here, but it starts maximally clamped and earns nothing on day one beyond proposing changes a human reviews.

SOX pilot — starting posture
Privacy
Privacy ModeCursor's setting that routes requests under zero-data-retention terms so providers don't store or train on your code. + ZDRZero Data Retention. A contractual guarantee that the model provider won't store your code or train on it. on (note: ZDR is not available with your own API keys).
Rules
Nested AGENTS.md: 'no schema/migration changes without human author', coverage + contract-test requirements, repository-pattern boundaries.
MCP
Read-only allowlist: Jira (read), Confluence runbooks (read). No write/action servers in the pilot.
Commands
Deny-by-default. Allow only: test runner, linter, git status/diff. Blocklist infra CLIs, package publish, network fetch.
Hooks
Pre-commit secret scan; block writes outside the service dir; log every tool call.
Execution
Terminal sandboxed; autonomous work runs in isolated Cloud Agent VMs with scoped, short-lived creds.
Merge gate
Agent never merges. Mandatory human review + separate approver to preserve segregation of duties. Audit logs + AI-code tracking on.

Least privilege isn't paranoia in a SOX repo — it's the auditable baseline you expand FROM.

Maturity path: autonomy is earned

You don't start at Cloud Agents auto-merging in a SOXSarbanes-Oxley Act. A US law that forces companies to keep auditable controls over any system that affects their financial reporting. repo — you start at 'propose, human disposes' and graduate rungs as evidence accrues: clean review pass rates, no escaped defects, audit trail intact. Box's published numbers (85%+ daily active, 30–50% throughput, +75% usage in six weeks driven by mentorship) came from staged adoption, not a big-bang autonomy switch. Higher autonomy is conditional on evidence + controls — never the start.

Interview answer

When a CISOChief Information Security Officer. The executive who owns security; usually the hardest and most important person to win over. asks 'how do we let agents into our SOXSarbanes-Oxley Act. A US law that forces companies to keep auditable controls over any system that affects their financial reporting. repo without failing an audit?' — walk the pilot: deny-by-default commands, read-only MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. allowlist, hooks for secret-scan and path-gating, sandboxed + VM-isolated execution, and a hard human-review/separate-approver merge gate that preserves segregation of duties. Then: we widen scope only as evidence earns it, with audit logs and AI-code tracking proving the control the whole way.

Self-check