Shattered Vales Studio Inc.

High-Efficiency LLM Prompting & AI Security

Large language models (LLMs) such as Claude are powerful tools for developers and business analysts alike, but the quality of what you get back depends on what you put in, and so does the risk. This guide covers how to get accurate results on the first try, how to keep token costs down, and the security rules every employee must follow.

Step 1: Understand What the Model Sees

A few facts about how LLMs work explain almost every tip in this guide:

Step 2: Set Context with a Prompt Framework

A zero-shot prompt is one that gets the right answer on the first try, without examples or follow-up corrections. The most common reason a prompt fails is that the model had to guess something you knew. Use the five-part framework below for any task more complex than a quick question. The parts don't need to be long; they need to be present.

PartAnswers the questionExample
RoleWhat expertise should it apply?"You are a senior C# developer experienced with Unity 2D."
ContextWhat's the situation, and why does this matter?"Our inventory system stores items in a List; players report lag when sorting 500+ items."
TaskWhat exactly should it do?"Rewrite SortInventory() to sort by rarity, then name."
ConstraintsWhat must it respect or avoid?"No LINQ (it allocates per frame); keep the public method signature."
FormatWhat should the answer look like?"Return only the method, then one sentence on its complexity."

Weak prompt:

Write a function to check if an invoice is overdue.

Strong prompt:

<role>
You are a senior C# developer on a multi-tenant SaaS billing system.
</role>

<context>
Each tenant sets its own grace period (0-90 days) after an invoice's
due date. Dates are stored in UTC; tenants have an IANA time zone.
</context>

<task>
Write IsOverdue(Invoice invoice, Tenant tenant, DateTimeOffset now).
An invoice is overdue when it is unpaid and the grace period has fully
passed in the tenant's local time zone.
</task>

<constraints>
- .NET 8, no third-party libraries.
- Paid or voided invoices are never overdue.
- If anything about the rule is ambiguous, ask before writing code.
</constraints>

<format>
The method, then xUnit tests covering: paid invoice, last day of grace,
first day after grace, and a tenant in UTC+13.
</format>

Step 3: Provide Schemas and Examples for Structured Output

When the answer will be read by code, or pasted into a tool such as a spreadsheet or issue tracker, don't describe the format in words; give the exact shape. A schema removes guesswork about field names, types, and allowed values.

Extract every acceptance criterion from the user story below.
Return ONLY valid JSON matching this schema, with no other text:

<schema>
{
  "storyId": "string",
  "criteria": [
    {
      "id": "string, e.g. AC1",
      "given": "string",
      "when": "string",
      "then": "string",
      "priority": "must | should | could",
      "ambiguities": ["string; empty array if none"]
    }
  ]
}
</schema>

<story>
...paste the user story here...
</story>

Step 4: Minimize Token Usage Without Losing Quality

Fewer tokens means faster answers, lower cost, and usually better results, because the model isn't distracted by irrelevant material. The goal isn't the shortest possible prompt; a vague prompt that needs three retries costs far more than a precise one. The goal is to send only what's relevant.

Instead ofDo this
Pasting a 2,000-line filePaste the one function involved, plus the signatures of what it calls.
Pasting a 10,000-line logPaste the error, the stack trace, and the 20 lines before it.
Asking for the whole file backAsk for "only the changed method" or a unified diff.
Open-ended answersSet a length: "under 150 words", "three bullet points", "code only".
Re-explaining the project in every chatKeep project context in a reusable file (such as CLAUDE.md) or a saved project prompt.
One endless conversationStart a fresh conversation for each new task. Summarize the useful conclusions into the new one if needed.
The largest model for everythingUse a smaller, faster model for simple tasks such as reformatting, summarizing, or boilerplate; save the largest model for complex reasoning.
Lockfiles, minified code, generated files, binary dataLeave them out. They are expensive and rarely useful.

When building features on the API: put the stable parts of the prompt (instructions, schemas, reference material) first and the per-request parts last. That lets prompt caching reuse the stable prefix across requests at a fraction of the cost. Set a sensible maximum output length on every call.

Step 5: Follow the Data Rules: What Must Never Be Shared

Anything you type or paste into an AI tool leaves your machine. Depending on the tool and plan, it may be logged, retained, reviewed by the vendor, or used for training. The studio classifies information into three tiers. These rules are mandatory, and they apply to every AI tool: chat apps, coding assistants, browser extensions, and AI features built into other products.

TierIncludesRule
Never share Credentials and secrets: passwords, API keys, tokens, private keys, certificates, connection strings, .env files.

Tenant and customer data: any data from production or customer environments, personal data (names, emails, addresses, IPs, payment details), support tickets, and logs or database exports containing any of it.

Security-sensitive details: vulnerability reports, penetration test results, and security controls such as anti-cheat, licensing, or fraud detection logic.
Never, in any AI tool, including approved ones. No exceptions without written approval from leadership.
Approved tools only Proprietary source code and core business logic (pricing and billing engines, game systems, tenant isolation code), internal architecture and infrastructure details, unreleased game content and roadmaps, client documents covered by an NDA. Only in AI tools on the studio's approved list, signed in with your studio account. Never in personal accounts or free consumer tools.
Open Public documentation, open-source code, general programming questions, synthetic or made-up example data. Any reputable tool.

If you're unsure which tier something falls into, treat it as the stricter one and ask your lead. Ask your lead for the current approved tools list; approval depends on the vendor's data-retention and training terms, which differ between consumer and business plans of the same product.

Step 6: Sanitize Before You Paste

Most debugging doesn't need real data. Before pasting code, logs, or examples, replace anything sensitive with realistic placeholders. The model can still reason about the shape of the problem.

Before (never paste this):

2026-10-21 14:02:11 ERROR Payment failed for tenant "Northwind Clinics"
  user=jane.doe@northwind.example card=4111********1111
  conn=Server=prod-sql-03.internal;User Id=svc_billing;Password=Hx9!q...
  at BillingService.Charge(Invoice inv) line 212

After (safe to paste):

2026-10-21 14:02:11 ERROR Payment failed for tenant "TENANT_A"
  user=USER_1@example.com card=[REDACTED]
  conn=[REDACTED CONNECTION STRING]
  at BillingService.Charge(Invoice inv) line 212

Step 7: Treat AI Output as Untrusted

AI output is a first draft from a fast, well-read, occasionally confidently wrong colleague. It goes through the same review as any human contribution, and you are accountable for anything you commit, send, or run.

  1. Read and understand every line before committing it. If you couldn't explain it in code review, don't submit it.
  2. Verify packages exist and are the real ones. Models sometimes suggest package names that don't exist, and attackers register those names with malicious code. Check the package's official page, publisher, and download history before installing.
  3. Never run a command you don't understand, especially anything with sudo, rm, curl … | sh, or a force-push.
  4. Beware of prompt injection. Text the AI reads (web pages, issues, documents, code comments) can contain hidden instructions aimed at it. Give AI agents the least access they need, and never production credentials.
  5. Check facts and business rules against the source of truth: the spec, the issue, or the client. Never against the model's own claims.