Structural Patterns

Agent Control Plane

Identity, gateway, policy, inspection, and audit are the structures that let marketing agents touch real systems without becoming unmanaged automations. This reference pattern turns the security architecture into a practical harness pattern.

Source

Related reading from AI Knowledge Hub: Secure Marketing Agents. The article develops an execution architecture; this pattern explores the control plane that marketing teams need before agents touch campaign data, commerce feeds, or publishing workflows.

Read article
Try the offline mock lab

Reference pattern

A governed route from agent intent to system action

AgentCampaign optimization agent

Plans the work, but does not hold platform credentials.

GatewayIdentity + policy boundary

Checks scope, account access, protocol rules, and approval gates.

ToolsGoogle Ads · DV360 · BigQuery · CMS

Run with scoped credentials owned by the gateway, not the agent.

AuditAction trail

Records actor, account, tool, decision, approver, and result.

Wrong default

Personal OAuth as agent identity

The agent inherits a human account, sees whatever the person sees, and breaks when the person leaves, rotates credentials, or changes roles. Audit also becomes ambiguous because human and agent actions collapse into one identity.

Safer pattern

Agent identity behind a gateway

The agent authenticates to the gateway. The gateway owns platform credentials, applies account-level policy, runs inspection, and logs the action trail separately from human activity.

Control layers

What the harness must provide

01

Agent Identity

Give every agent its own identity, scope, owner, and lifecycle instead of letting it borrow a human OAuth session.

02

Gateway

Route every tool call through one controlled boundary that can enforce account access, protocol rules, and approval gates.

03

Policy

Define which accounts, tools, budgets, write actions, and data classes the agent can touch before execution begins.

04

Inspection

Scan prompts, tool arguments, URLs, and responses for injection, leakage, unsafe destinations, and policy violations.

05

Audit

Log agent actions separately from human actions, including scope, tool, input hash, output hash, status, and approver.

Execution path

How a campaign data request should move

  1. 01

    Agent requests campaign metrics

  2. 02

    Gateway checks agent identity

  3. 03

    Policy resolves allowed accounts

  4. 04

    Tool call runs with scoped credentials

  5. 05

    Audit log stores the action trail

Approval gates

Risk decides whether the agent can act

ActionRiskControl
Read campaign metricsLowAllow if account scope matches the agent policy.
Export customer-level dataHighBlock by default or require security approval and redaction.
Change campaign budgetHighRequire human approval, budget cap, and post-action audit event.
Publish creativeMediumRequire brand and compliance review before the tool call executes.

Skills · Run locally

Review evidence before approving an action

Before a reviewer approves a campaign action, they need to know which data the agent used and how it checked the result. The ChatGPT Advertising Experiment Plugin 0.2.0 lets you inspect that evidence with fictional account and campaign data. View the Skills release manifest for 0.2.0

Use Python 3.9 or newer and run these commands from the Skills repository. If you need to build ./bin/skills-hub, install Go and run make cli-build there first. Open the Skills repository

Installation downloads the pinned release into a temporary directory. The mock run then uses the bundled data without credentials or network access. Open the plugin in the Skills catalogue

Install and run the local mock lab
lab_dir=$(mktemp -d) &&
./bin/skills-hub install \
  --source remote --module plugins \
  --registry-url https://skills.ai-knowledge-hub.org/registry/plugins-index.json \
  --entry marketing/chatgpt-advertising-experiment-plugin@0.2.0 \
  --runtime codex --execution-runtime python3 \
  --target "$lab_dir/plugins" --cache-dir "$lab_dir/cache" &&
cd "$lab_dir/plugins/marketing/chatgpt-advertising-experiment-plugin" &&
python3 scripts/run_mock_lab.py

Open output/mock-evidence-bundle.json in the installed plugin directory. The sample records zero network calls and one valid test conversion. In a separate matching example, it finds two event records, removes one duplicate, and matches one business outcome. Check those counts before using the bundle to inform a review.

The lab exercises the evidence step. A live account read requires separate setup and verification, and the release has no live write adapter. To practise collecting report pages and handling missing results, try the separate Harness sample collector.

Monday morning checklist

Questions to ask before deploying an agent

01

Does the agent have its own identity, or does it inherit a person's credentials?

02

Can access be revoked without touching the human account?

03

Which gateway sees every outbound tool call?

04

Which actions require approval before execution?

05

Can the audit log separate agent activity from human activity?