/firefly-services:firefly-brand-guardrailsfrom firefly-services
Enforce brand compliance on generative output — custom-model lock-in, prompt and output content filtering, asset tagging for downstream policy, and the human-review queue pattern for regulated or brand-sensitive workloads. Use whenever the user mentions "brand compliance", "brand safety", "regulated industry", "review queue", "approval workflow", "content moderation", "brand guardrails", "legal review", "compliance hold", or generates assets for financial services, pharma, automotive, public sector, or any customer with a brand-review process. Encodes the production guardrail pattern that turns "Firefly generates whatever it wants" into "every asset that ships passes a documented compliance gate."
Ships in firefly-services. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The compliance layer for production generative pipelines. Base Firefly is commercially-safe at the model level — IP-safe training data, output filtering for harmful content. But "commercially safe" is not the same as "on brand." Brand guardrails are the customer-specific layer that sits between Firefly and the customer's published assets.
This skill encodes the pattern that converts a generative pipeline from "marketing previews the output" to "every shipped asset has a documented approval lineage that survives legal audit."
Use this skill when:
Do NOT use this skill when:
Brand guardrails are not a single feature. They are four layers, each filtering at a different stage:
Layer 1: Model-level lock-in (custom models, deny base model entirely)
↓
Layer 2: Prompt-side filtering (deny-list, prompt rewriting, banned terms)
↓
Layer 3: Output-side filtering (visual classifiers, content tags, moderation API)
↓
Layer 4: Human review queue (sampling for spot-check, blocking for high-risk)
A regulated-industry pipeline runs all four. A brand-sensitive but not regulated pipeline often runs 1, 2, and 4, skipping 3 for cost reasons.
The strongest guardrail is restricting which model can run at all. For brand-critical workflows, the pipeline does not call the base Firefly model — it only calls custom models trained on approved brand assets.
| Approach | Pattern |
|---|---|
| Hard lock | Pipeline code refuses to submit any generation that does not include a customModelId from an allowlist |
| Soft lock | Base model allowed for internal previews; custom model required for any output that goes to S3 with intent=published |
| Per-campaign lock | Campaign config specifies the exact customModelId; pipeline rejects mismatches |
Implementation sketch:
const ALLOWED_MODELS = new Set([
'brand-light-icon-style-v3',
'brand-dark-icon-style-v3',
'brand-product-subject-v2',
]);
function validateGenerationRequest(req) {
if (req.intent === 'published' && !ALLOWED_MODELS.has(req.customModelId)) {
throw new GuardrailViolation(
`Published generations must use an approved custom model. Got: ${req.customModelId ?? 'none'}`
);
}
if (req.intent === 'published') {
req.headers['x-model-version'] = 'image3_custom'; // required for custom models
}
}
See firefly-custom-models for the full custom-model lifecycle.
Two patterns: deny-list and rewriting.
A list of banned terms (competitor names, prohibited categories, brand-conflict phrases). Pipeline rejects prompts containing any term on the list.
| List type | Examples (generic) |
|---|---|
| Competitor terms | Competitor product names, competitor tagline phrases |
| Regulated content | Drug brand names, medical claim language, financial promise language |
| Brand voice | Slang, jargon, or tone that conflicts with brand guidelines |
| Subject restrictions | "minor", "child" (if brand prohibits), "weapon" (if brand prohibits) |
Match deny-list terms case-insensitively, with simple stem rules. Aggressive regex matches over-filter — be specific. Maintain the list in version control, not in code, so legal can update without a deploy.
For terms that should be substituted rather than rejected, run a rewriting pass:
| Input fragment | Rewritten |
|---|---|
| "modern office" | "modern office with brand-compliant interior elements" |
| "person at desk" | "professional, age 25-55, business-casual attire, at desk" |
Rewriting is a Lambda that runs before the Firefly call. Keep it deterministic — same input always produces the same output. Log both the original and rewritten prompt for audit.
Firefly's built-in content filtering blocks the obvious (CSAM, gore, explicit content). Brand filtering is the layer on top.
Three options, in order of cost:
| Option | Cost | Accuracy | When |
|---|---|---|---|
| Tag-only (defer to humans) | $0 | N/A | Always — at minimum, tag for downstream policy |
| Computer-vision classifier (off-the-shelf) | Low | 70-85% | Regulated industries; high-volume |
| Custom classifier trained on brand examples | Medium | 90%+ | Brand-critical workflows with budget |
For every generated asset, attach metadata at persistence time:
{
"modelId": "brand-light-icon-style-v3",
"promptHash": "sha256:...",
"outputDimensions": "1920x1080",
"generatedAt": "2026-05-19T14:21:08Z",
"complianceTags": {
"containsPerson": null,
"containsCompetitorBranding": null,
"containsRegulatedSubject": null
},
"humanReview": "pending"
}
complianceTags starts as null. A reviewer (or classifier) fills them in. The pipeline holds publication until they are non-null and pass policy.
For volume workloads, run a classifier between Firefly success and S3 persistence:
Firefly success → download output → classifier → tag results → persist + queue for review
Use a hosted classifier (AWS Rekognition, GCP Vision AI, Azure Computer Vision) for off-the-shelf coverage. Custom classifiers (trained on Sagemaker / Vertex AI / Azure ML) for brand-specific concepts (e.g., "is the brand logo present and correctly placed").
The terminal guardrail. Even with the previous three layers, some percentage of assets land in a review queue before they can ship.
| Mode | Volume to review | When |
|---|---|---|
| 100% | Every asset | Highest-risk: regulated industries, brand launches, executive-visible campaigns |
| Sampling (e.g., 10%) | Random + flagged-by-classifier | Steady-state brand-sensitive workloads |
| Flagged-only | Only assets the classifier flagged | High-volume after the pipeline has earned trust |
A typical FDE engagement starts at 100%, tightens to sampling once the team trusts the pipeline (usually 4-8 weeks in), then drops to flagged-only after a quarter of clean operation.
Pipeline output (status=succeeded, humanReview=pending)
↓
SNS topic: needs-review
↓
Review UI (custom-built or Workfront / Asana / Jira)
↓
Reviewer marks: approved | rejected | escalate
↓
├── approved → S3 tag humanReview=approved; release for publication
├── rejected → S3 tag humanReview=rejected; move to /rejected/ prefix; notify originator
└── escalate → second-level reviewer (legal / brand director); notification + SLA timer
| Concern | Pattern |
|---|---|
| SLA | Track review queue depth and per-asset wait time; alarm if p95 wait > customer-agreed SLA |
| Reviewer load | Round-robin assignment with caps per reviewer per day; prevent reviewer burnout |
| Audit trail | Every review decision logged with reviewer ID, timestamp, and reason if rejected |
| Recall | If a reviewer mistakenly approves something, a "recall" action retroactively rejects and pulls the asset |
Reviewers should not free-text reject. Maintain a fixed taxonomy:
| Code | Meaning | Pipeline action |
|---|---|---|
R-COMPETITOR | Competitor branding visible | Block; retrain custom model if recurring |
R-OFF-BRAND-COLOR | Color palette wrong | Adjust prompt or retrain |
R-OFF-BRAND-COMPOSITION | Composition violates brand guidelines | Adjust template |
R-SUBJECT-INAPPROPRIATE | Subject matter outside brand voice | Adjust prompt; add deny-term |
R-QUALITY | Visual quality below standard | Regenerate (different seed); see firefly-cost-optimization |
R-LEGAL-CLAIM | Implies medical / financial / safety claim | Block; flag for legal review |
The taxonomy feeds back into the deny-list and the custom model retraining cycle. A workflow without this feedback loop will repeat the same rejections forever.
In the firefly-batch-pipeline Step Functions state machine, the review gate is a state after persistence:
... → PersistAssets → TagForReview → WaitForHumanReview → PublishOrReject
WaitForHumanReview uses waitForTaskToken — the state pauses until the review UI calls SendTaskSuccess (or SendTaskFailure if rejected). Wait timeout = customer-agreed SLA + buffer. Past the timeout, escalate.
| Concern | Pattern |
|---|---|
| Pipeline blocking on slow review | Track per-campaign queue depth; alarm and add reviewer capacity |
| Customer paid for generation that was rejected | Cost reconciliation includes rejection rate (see firefly-cost-optimization) |
| Reviewers want to compare against approved examples | Build a "reference grid" UI showing 4-6 approved examples next to the candidate |
The guardrail stack is production-ready when:
intent=published generations without an approved customModelIdcomplianceTags and humanReview metadatafirefly-custom-models §7).intent. For any intent=published, no bypass — that is the whole point of the gate.humanReview=recalled, alerts brand team, and logs the case for taxonomy expansion.firefly-custom-models — Layer 1 lock-in depends on a healthy custom-model libraryfirefly-batch-pipeline — Where the review gate plugs into the production state machinefirefly-cost-optimization — Rejection rate is a primary cost-burn driverfirefly-services-storage-refs — Where the compliance metadata gets attachedfirefly-services-troubleshoot — When 422s spike, the deny-list or model needs attentionWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub focus-gts/firefly-services-skills --plugin firefly-services19 skills in this plugin
/firefly-batch-pipelineThe end-to-end production reference architecture for high-volume generative campaign workloads on Adobe Firefly Services — SQS-fronted intake, Lambda worker pool with per-credential token-bucket pacing, Step Functions orchestration for multi-stage PSD composition, DynamoDB job state, S3 result persistence, DLQ replay, and webhook-driven customer notification. Use whenever the user mentions "batch pipeline", "campaign at scale", "thousands of images per day", "generative pipeline", "campaign assembler", "asset factory", "production-grade pipeline", or designs a system that combines Firefly generation with Photoshop composition at volume. Stitches `firefly-services-rate-limits` and `photoshop-api-composition` into a single deployable blueprint./firefly-cost-optimizationThe production playbook for understanding and controlling Adobe Firefly Services consumption — where API spend actually goes, what to cache, what to batch, seed reuse for deterministic regenerations, prompt deduplication, response caching, custom-model-vs-style-reference cost tradeoff, and the "why is consumption 3× higher than expected" debugging sequence. Use whenever the user mentions "cost", "consumption", "API spend", "budget", "billing surprise", "consumption is high", "credits burning fast", "FinOps", "cost overrun", or wants to understand the cost shape of a generative pipeline before deploying it. Encodes the FinOps pattern that keeps generative pipelines on budget at scale./firefly-custom-modelsTrain, manage, and invoke Adobe Firefly Custom Models — subject vs style models, training data preparation (10-30 reference images), training submission and polling, asset ID management, generation with `customModelId` and `x-model-version: image3_custom`, retraining cadence, and brand-aligned generation at scale. Use whenever the user mentions "custom model", "brand model", "train a model", "fine-tune Firefly", "subject model", "style model", "Custom Models API", `customModelId`, or describes iconography / brand-asset / character generation that requires consistency. Encodes the production pattern for brand iconography workflows where custom-model output dramatically reduces design cycle time./firefly-expand-fillUse Adobe Firefly's Generative Expand and Generative Fill APIs — when to use each, masking strategies, placement and aspect ratio control, prompt patterns for clean extension and inpainting, and the difference between filling versus replacing image regions. Use whenever the user mentions "generative expand", "extend canvas", "generative fill", "inpaint", "outpaint", "remove object", "replace background", "expand image", "fill image", "masking", "expand-async", "fill-async", or wants to grow / patch / modify an existing image. Encodes production patterns for background extension on hero assets and for brand-aligned background replacement in high-volume template-driven campaign asset production./firefly-generate-image-v3-asyncGenerate images with the Adobe Firefly V3 asynchronous API — job submission, status polling, webhook callbacks, prompt structure, content class, style and structure references, seed control, multi-variation results, and the migration from V2 sync to V3 async. Use whenever the user wants to "generate an image with Firefly", "text-to-image", "Firefly V3", "async generate", "polling", "jobId", "statusUrl", or upgrades from V2 sync. Returns the production pattern for the highest-volume Firefly workload — including a polling cadence that avoided rate limiting in live testing and a webhook design pattern for scaling to thousands of concurrent jobs./firefly-generate-similarGenerate variations of an existing image using Adobe Firefly's Generate Similar API — how it differs from Generate Image with a style reference, when to use it for campaign variation generation, controlling variation diversity, multi-variation batches, and the production pattern for "give me 50 variations of this hero asset". Use whenever the user wants "variations", "more like this", "similar images", "generate-similar", "give me 10 versions of this", or runs campaigns that need many derivatives of a single approved hero. Encodes the variation-generation pattern used in production for enterprise campaign asset multiplication.