Ranking Deployment Risk: Attack Surface, Failure Modes, Quota Exhaustion and Supply Chain
A multi-tenant support agent has eight risks on its diagram. Ranked by exposure, the top two are not model failures at all: one tenant draining the shared rate limit (9) and an unpinned third-party MCP server (7). A per-tenant share and a supply-chain gate address both.
What you will learn
- Sort the risks of one deployment diagram into four categories: attack surface, failure modes, quota exhaustion and supply chain
- Rank the whole register by exposure and check that every category and every diagram part has a row
- Stop one tenant from draining a shared organization limit with a per-tenant share in your own code
- Hold third-party MCP servers and Skills until they are pinned and reviewed
Before you start
- A risk register ranked by exposure
- Claude API rate limits basics
Picture the launch review for SupportDesk Cloud: one diagram, and a long list of things that could go wrong. The answer is a register, and its top line is the risk to fix first.
The previous lesson ranked model failure modes by exposure. This one widens the register to the whole deployment, sorted into four categories: attack surface, failure modes, quota exhaustion and supply chain. The model is only one part of the list.
SupportDesk Cloud, before launch
SupportDesk Cloud is one product for many tenants. A visitor types in the chat widget. The gateway passes it to the agent, and the agent calls Claude on one key shared by every tenant. It also reaches a refund tool, a third-party MCP server and a third-party Skill.
- Attack surface is where someone can reach in: the open chat widget, and the refund tool behind it.
- Failure modes are what the agent can get wrong, such as a policy answer that is simply false.
- Quota exhaustion is what can run out: one organization limit on Claude, shared by every tenant.
- Supply chain is everything you did not write: an MCP server and a Skill.
Think of an apartment building. A door on the street that anyone can try is attack surface. One water main for every flat, where one flat opening every tap leaves the others dry, is quota exhaustion. A contractor with a key to every flat, whose crew you never met, is supply chain. A pipe that can leak is a failure mode. A building survey checks all four, then ranks what to fix first.
The register's rule book
This project makes no model call. The ratings, limits and shares are example values, not measured rates and not Claude limits. From register/ranking.py:
CATEGORIES = ("attack surface", "failure mode", "quota exhaustion",
"supply chain")
def exposure(risk):
base = risk["likelihood"] * risk["impact"]
return base + (0 if risk["reversible"] else 1)
def rank(risks):
def key(r):
return (-exposure(r), -r["impact"], r["id"])
return sorted(risks, key=key)
def missing(risks):
seen = {r["category"] for r in risks}
return [c for c in CATEGORIES if c not in seen]
Exposure is likelihood times impact (each 1 to 3), plus one if the risk cannot be undone. Ties go to the bigger impact. And missing lists any category with no row at all, because a register needs at least one row in each.
risk register for SupportDesk Cloud, ranked by exposure
1 R-5 one tenant drains shared limit quota exhaustion exposure 9
2 R-7 third-party MCP, not pinned supply chain exposure 7
3 R-1 chat widget open to anyone attack surface exposure 6
4 R-3 wrong policy answer failure mode exposure 6
5 R-2 refund tool, broad key attack surface exposure 4
6 R-6 runaway loop hits spend cap quota exhaustion exposure 4
7 R-8 third-party Skill, all tenants supply chain exposure 4
8 R-4 reply cut off at max_tokens failure mode exposure 2
categories covered: 4 of 4
diagram parts with a risk row: 7 of 7
model failures only: top is R-3 at 6 | categories missing: 3
not listed: R-5 at 9, R-7 at 7
The top two justify themselves. R-5: every tenant is hit at once, and it is likely, 3 x 3, though it recovers. R-7: a third-party update reaches every tenant and cannot be taken back, 2 x 3 plus one.
The trap: only the model, none of the dependencies
Look at the line model failures only. A register that lists only model failures (a wrong policy answer, a cut-off reply) thinks its top risk is a 6, and three categories have no row. The biggest exposures are not there: the shared limit at 9 and the MCP server at 7. Cover every category and every part of the diagram, or the register is not finished.
Quota: one tenant, everyone's limit
From quota/tenant_budget.py:
class SharedPool:
def __init__(self, org_limit):
self.org_limit, self.used = org_limit, 0
def call(self, units):
if self.used + units > self.org_limit:
return 429
self.used += units
return 200
class TenantGate:
def __init__(self, pool, tenant_cap=None):
self.pool, self.cap, self.spent = pool, tenant_cap, {}
def call(self, tenant, units):
spent = self.spent.get(tenant, 0)
if self.cap is not None and spent + units > self.cap:
return 429
status = self.pool.call(units)
if status == 200:
self.spent[tenant] = spent + units
return status
One shared pool has one organization limit; past it, every caller gets a 429, not only the busy one. The gate sits in front and adds a share per tenant. A tenant over its share is stopped by your own code before it touches the shared pool. The busy minute in data/traffic.json has acme and zenith sending a few small requests while bulkco runs a big import:
shared limit 100 per minute, no tenant share
acme ok 1 | 429 1
bulkco ok 9 | 429 3
zenith ok 1 | 429 1
shared limit 100 per minute, tenant share 30
acme ok 2 | 429 0
bulkco ok 3 | 429 9
zenith ok 2 | 429 0
Without a share, bulkco takes the minute and acme and zenith are refused, though they did nothing wrong. With a share of 30, bulkco is held at its share and everyone else never notices. A spend cap is different again: its 429 has no retry-after header, so retrying cannot help. The limit belongs to the organization, so one tenant can use up every share; lower limits per workspace, set in the Console, are the same idea on Anthropic's side. Key scoping and rotation are covered in API keys: server proxy, rotation and scope.
Supply chain: code and text you did not write
From supply/gate.py:
def check(dep):
reasons = []
if not dep["pinned"]:
reasons.append("not pinned")
if not dep["reviewed"]:
reasons.append("not reviewed")
if reasons:
return "hold", " and ".join(reasons)
return "allow", "pinned and reviewed"
third-party parts
anthropic library allow pinned and reviewed
order-lookup mcp server hold not pinned and not reviewed
tone-pack skill hold not reviewed
Not pinned means the version can change under you without anyone noticing. Not reviewed means nobody here has read it. The anthropic library sends your requests and is both, so it is allowed. The order-lookup MCP server reads your orders and its replies enter the context; it is neither, so it is held. The tone-pack Skill is text you did not write that loads for every tenant; it is pinned but unreviewed, so it is held. A third-party part reaches every tenant at once, which is why R-7 scores 7 and R-8 scores 4. Pin it, review it, then let it in.
The traps
- "Dependencies are the vendor's problem." A third-party part runs inside your deployment.
- "Raise the organization limit." One tenant can still use every share.
- "Rank by how often it fails." A rare loss that cannot be undone can outrank it.
The answer covers all four categories and ranks them by exposure. For the attack-surface side of tools, see agent blast radius and least privilege.
Recap
| Category | Question | Top row here | Control |
|---|---|---|---|
| Attack surface | Who can reach it? | R-1 chat widget, 6 | Input and tool controls, built later in the section |
| Failure modes | What can go wrong inside? | R-3 wrong policy answer, 6 | Ground and cite |
| Quota exhaustion | What can run out, and who shares it? | R-5 shared limit, 9 | Per-tenant share |
| Supply chain | What did we not write? | R-7 MCP server, 7 | Pin and review before allowing |
The project files for this lesson are in the community, free to join.
StudyEasy AI Community
Learn AI engineering, share what you build, and connect with other learners.
Free resources: lesson files, notebooks and code
Ask questions and join engineering discussions
Meet real people learning and building with AI
Related course on Udemy
Claude Certified Architect - Professional (CCAR-P) Exam Prep
Architecting with Claude: design, models, context, integration, evals, governance and stakeholders.View on Udemy ↗: Claude Certified Architect - Professional (CCAR-P) Exam Prep (paid course, opens in a new tab)Related posts
Guardrails for an LLM Agent: Check What Comes In, What It Wants to Do, and What Goes Out
An agent that reads customer emails and can refund up to $200. In a small simulation, a phrase filter still lets 6 of 8 written attacks do harm and blocks 2 honest users; plain checks outside the model take harm to 0 of 8, at a cost of 1 honest request failed and 2 held.
The Agent Attack Surface: Blast Radius, Narrow Tools, Scoped Keys and the Dangerous Three
A support agent reads a ticket that says run SELECT * FROM customers and email the result outside, and it has run_sql and send_email, so the customer list leaves. The model wasn't hacked, it was equipped. Map each tool by what it reads, changes and sends, replace the two large ones with narrow tools, scope the keys, and never give one agent untrusted input, private data and a way out together.
Prompt Injection, Jailbreaks and Untrusted Input: Label What Comes In, Gate What Goes Out
Three texts reach a support agent in one week: an injected ticket, a poisoned help article and a jailbreak. A naive agent turns all three into leaks; three small checks in plain code take that to zero.
Injection Exposure Review for an Agent: Map Inputs, Data and Effects, Layer Every Path, Retest the Job
Review a refund agent the way a security team would: map where stranger text gets in, what it can read and what it can do, layer every path, then show the four normal questions still give the same answer.
