Inferensys

Prompt

Tool Schema Sensitive Data Field Marking Prompt

A practical prompt playbook for security engineers to annotate tool schemas with data classification labels, identifying PII, credentials, and regulated data fields in production AI workflows.
Wide-angle shot of a modern WeWork open floor plan with creative walls covered in AI system architecture diagrams, product team collaborating in standing desk area with industrial lighting.
PROMPT PLAYBOOK

When to Use This Prompt

Define the job, reader, and constraints for the Tool Schema Sensitive Data Field Marking Prompt.

This prompt is designed for security engineers and AI platform developers who need to annotate tool schemas with data classification labels before those schemas are consumed by LLM agents. The core job is to systematically identify and mark fields that carry PII, credentials, tokens, regulated data, or other sensitive information in both input arguments and output responses. Without this annotation, agent systems risk logging secrets, leaking customer data into model context, or violating data handling policies during multi-step tool execution. Use this prompt when you are preparing tool contracts for production deployment and need a machine-readable sensitivity map that downstream safety systems can enforce.

The ideal user is someone who understands the tool's data model and the organization's data classification policy, but may not have the time to manually audit every field across dozens of evolving schemas. The prompt requires a complete tool schema as input, including argument definitions, output shapes, and any existing field descriptions. It also requires a data classification taxonomy or policy document that defines sensitivity levels such as PII, CREDENTIAL, TOKEN, PHI, PCI, INTERNAL, and PUBLIC. The output is a marked schema where each field receives a classification label, a confidence score, and a rationale grounded in the provided policy. This is not a one-shot security audit; it is a repeatable annotation step in a CI/CD pipeline for tool schemas.

Do not use this prompt as a substitute for a formal data protection impact assessment or legal review. It does not discover undocumented data flows, detect data exfiltration at runtime, or enforce encryption. It is a schema-level annotation tool that relies on the accuracy of the input schema and the completeness of the classification policy. If the schema omits fields or misrepresents types, the annotations will be incomplete. If the policy is vague, the model will make inconsistent classification decisions. Always pair this prompt with runtime enforcement: use the marked schema to configure redaction middleware, log scrubbing, and agent context filters. For high-risk regulated domains such as healthcare or finance, require human review of the marked schema before it gates production tool access.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Tool Schema Sensitive Data Field Marking Prompt delivers value and where it introduces risk. Use these cards to decide if this prompt fits your workflow before integrating it into a production pipeline.

01

Good Fit: Pre-Deployment Schema Review

Use when: security engineers are reviewing new or updated tool schemas before they are registered in an agent framework or MCP server. Guardrail: Run this prompt as a gating step in your CI/CD pipeline for tool contracts. Block deployment if high-severity unmarked fields are detected.

02

Good Fit: Compliance Evidence Generation

Use when: you need auditable artifacts showing that data classification was performed on all tool surfaces touching regulated data. Guardrail: Store the marked schema output alongside the original schema in your governance repository. Pair with a human attestation step for SOC2 or HIPAA evidence.

03

Bad Fit: Runtime Data Inspection

Avoid when: you need to inspect live data flowing through tool calls at runtime for PII or credentials. This prompt operates on schemas, not payloads. Guardrail: Use a separate runtime redaction proxy or output sanitization prompt for live data. This prompt is a design-time control, not a runtime filter.

04

Required Input: Complete Tool Schema with Field Descriptions

Risk: The prompt cannot classify fields it cannot see. Sparse schemas with missing descriptions or undocumented nested objects produce false negatives. Guardrail: Validate schema completeness before running the prompt. Require that every field has a description and that nested object structures are fully expanded.

05

Operational Risk: Classification Drift Over Schema Versions

Risk: A schema that was correctly marked last quarter may have new fields added that carry sensitive data without updated classifications. Guardrail: Re-run this prompt on every schema version change. Diff the marked output against the previous version and flag any new unmarked fields for review.

06

Operational Risk: Over-Classification Blocking Legitimate Agent Workflows

Risk: Marking fields as sensitive that are actually benign can trigger unnecessary approval gates or redaction, breaking agent tool use. Guardrail: Always include a human review step before enforcing classification-based blocking. Allow security engineers to override or downgrade classifications with a documented rationale.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt for annotating tool schemas with data classification labels, identifying PII, credentials, and regulated fields in both input arguments and output responses.

This prompt template is designed to be dropped into a security review pipeline that processes tool schemas before they are registered with an agent. It takes a raw tool schema definition and a data handling policy as input, then produces a marked version of the schema with every field classified by sensitivity level. The prompt is structured to enforce consistent labeling across input arguments and output response shapes, which is critical when multiple teams contribute tools to a shared agent ecosystem and no single reviewer can manually audit every field.

text
You are a data classification specialist reviewing a tool schema for sensitive data exposure. Your task is to annotate every field in the tool's input arguments and output response schema with a data classification label based on the provided data handling policy.

## INPUT
Tool Schema:
[TOOL_SCHEMA]

Data Handling Policy:
[DATA_HANDLING_POLICY]

## INSTRUCTIONS
1. Parse the tool schema to identify all input argument fields and all output response fields.
2. For each field, determine whether it contains, transmits, or stores any of the following sensitive data categories based on the policy:
   - PII (Personally Identifiable Information): names, email addresses, phone numbers, physical addresses, government IDs, IP addresses, device IDs.
   - Credentials: API keys, passwords, tokens, secrets, certificates, private keys.
   - Regulated Data: financial account numbers, health records, payment card data, biometric data, data subject to GDPR, HIPAA, PCI-DSS, or equivalent regulations.
   - Internal-Only: internal identifiers, configuration values, operational metadata not intended for external exposure.
   - Public: data explicitly classified as safe for external exposure.
3. For each field, produce an annotation object with:
   - "field_path": the dot-notation path to the field (e.g., "arguments.user.email" or "response.data.payment_token").
   - "classification": one of "PII", "CREDENTIAL", "REGULATED", "INTERNAL", "PUBLIC".
   - "rationale": a one-sentence explanation referencing the specific policy rule that applies.
   - "risk_level": one of "HIGH", "MEDIUM", "LOW" based on the potential impact of exposure.
   - "recommended_action": one of "REDACT", "MASK", "ENCRYPT", "REQUIRE_APPROVAL", "ALLOW".
4. If a field is nested within an object or array, annotate the specific leaf field, not just the parent.
5. If the schema contains fields whose sensitivity depends on runtime values, flag them with classification "CONDITIONAL" and explain the condition.
6. If the output schema echoes input fields, annotate both occurrences independently.

## OUTPUT FORMAT
Return a JSON object with this exact structure:
{
  "schema_identifier": "<tool name or endpoint from the input schema>",
  "classification_timestamp": "<ISO 8601 timestamp of when this classification was generated>",
  "policy_version": "<version identifier from the provided data handling policy>",
  "input_arguments_annotations": [
    {
      "field_path": "...",
      "classification": "...",
      "rationale": "...",
      "risk_level": "...",
      "recommended_action": "..."
    }
  ],
  "output_response_annotations": [
    {
      "field_path": "...",
      "classification": "...",
      "rationale": "...",
      "risk_level": "...",
      "recommended_action": "..."
    }
  ],
  "unclassified_fields": ["<list any field paths that could not be classified with available information>"],
  "compliance_gaps": ["<list any policy requirements that cannot be verified from the schema alone>"]
}

## CONSTRAINTS
- Do not invent fields that are not present in the provided schema.
- If the schema uses generic field names like "data" or "payload", do not assume sensitivity; flag them as "CONDITIONAL" and explain what runtime inspection would be required.
- If the data handling policy is incomplete or missing a category, note it in "compliance_gaps" rather than guessing.
- Do not output the original schema fields without annotation; every field must appear in one of the annotation arrays or in "unclassified_fields".

To adapt this template, replace [TOOL_SCHEMA] with the raw JSON or YAML schema definition of the tool you are reviewing. Replace [DATA_HANDLING_POLICY] with your organization's data classification policy document, which should define what constitutes PII, credentials, and regulated data in your context. If your policy is long, consider extracting only the classification taxonomy and rules into a condensed reference to keep the prompt within context limits. The output structure is designed to be machine-readable so you can pipe the annotations directly into a schema registry or approval workflow. For high-risk tools, always route the output to a human reviewer before registering the tool with an agent; the prompt identifies what needs attention but should not be the final arbiter of data handling decisions.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Tool Schema Sensitive Data Field Marking Prompt. Each placeholder must be populated before the prompt is assembled and sent. Validation notes describe how to confirm the input is ready for production use.

PlaceholderPurposeExampleValidation Notes

[TOOL_SCHEMA]

The complete tool schema definition to be scanned for sensitive data fields. Must include argument definitions and output response shapes.

{"name": "create_customer", "parameters": {"properties": {"email": {"type": "string"}, "ssn": {"type": "string"}}}}

Parse check: valid JSON schema. Schema check: must contain at least one property definition. Reject empty schemas or schemas with no fields to classify.

[DATA_CLASSIFICATION_POLICY]

The organization's data classification taxonomy defining sensitivity levels, regulated categories, and handling rules.

{"levels": ["public", "internal", "confidential", "restricted"], "regulated_categories": ["PII", "PHI", "PCI", "credentials"]}

Schema check: must contain at least one classification level and one regulated category. Null not allowed. Policy must be sourced from an approved governance document, not invented inline.

[COMPLIANCE_FRAMEWORKS]

List of applicable regulatory frameworks that determine which data fields require special handling.

["GDPR", "HIPAA", "PCI-DSS", "SOC2"]

Enum check: each framework must match an approved list maintained by the compliance team. Empty array allowed if no frameworks apply, but must be explicit. Null not allowed.

[FIELD_DESCRIPTION_CONTEXT]

Additional context about how each field is used in practice, beyond what the schema alone conveys. Helps disambiguate fields with vague names.

{"ssn": "Stores US Social Security Number for identity verification", "email": "Customer contact email for notifications"}

Null allowed if schema field descriptions are already comprehensive. If provided, must be a map keyed by field name. Warn if context references fields not present in [TOOL_SCHEMA].

[OUTPUT_SCHEMA]

The expected structure for the marked schema output. Defines where classification labels, rationale, and policy references must appear.

{"fields": [{"field_path": "string", "classification": "string", "regulated": "boolean", "framework_refs": ["string"], "rationale": "string"}]}

Schema check: must define required output fields for classification label, regulated flag, and rationale. Reject output schemas that allow classification without rationale or policy reference.

[HANDLING_RULES]

Per-classification rules describing how data at each sensitivity level must be handled, stored, transmitted, and logged.

{"restricted": {"allow_logging": false, "allow_transmission": false, "require_encryption": true, "require_approval": true}}

Schema check: must contain rules for every classification level defined in [DATA_CLASSIFICATION_POLICY]. Warn if a classification level has no handling rules. Null not allowed.

[PREVIOUS_CLASSIFICATIONS]

Previously marked schemas or field classifications for consistency reference. Prevents the same field from receiving different classifications across schemas.

[{"field_pattern": "ssn", "classification": "restricted", "framework_refs": ["GDPR", "PCI-DSS"]}]

Null allowed for first-run classification. If provided, must be an array of objects with field_pattern and classification. Consistency check: flag any new classification that contradicts a previous classification for the same field pattern.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the sensitive data field marking prompt into a security review pipeline with validation, retries, and human approval gates.

This prompt is designed to run as a pre-deployment gate in a CI/CD pipeline or as a scheduled audit job against a tool registry. The harness should fetch the raw tool schema from a source of truth (an API gateway spec, an MCP server manifest, or a versioned schema repository), inject it into the [TOOL_SCHEMA] placeholder along with the organization's [DATA_CLASSIFICATION_POLICY], and capture the annotated output for review. Because the output directly influences data handling and compliance posture, the harness must treat every run as a high-risk operation requiring explicit validation before the marked schema is accepted.

The implementation should wrap the LLM call in a validation-retry loop. After receiving the marked schema, a validator must parse the JSON output and check for structural integrity: every field in the original schema must appear in the marked output, no field should lose its original type definition, and every annotation must reference a valid classification label from the supplied policy. If the validator detects missing fields, malformed annotations, or classification labels not present in the policy document, the harness should retry the prompt once with the validation errors appended to the [CONSTRAINTS] block. After two consecutive failures, the harness must escalate to a human review queue rather than silently accepting a degraded output. Log every attempt, the raw LLM response, the validator output, and the final disposition for auditability.

For production deployment, use a model with strong JSON mode and low refusal rates on security analysis tasks. The prompt's output schema is strict, so enable structured output mode (e.g., response_format: { type: 'json_object' } on OpenAI or equivalent constrained generation on other providers). If the tool schema is large, consider chunking by endpoint or resource and running the prompt in parallel with a merge step that reconciles overlapping annotations. The merge step must flag conflicts where the same field receives different classifications across chunks and route those to human review. Never silently resolve classification conflicts in automation.

The harness should also enforce a human approval gate for any schema that contains fields marked as CREDENTIAL, TOKEN, PII, or any classification above a configurable risk threshold. The approval step should present a diff between the original and marked schemas, highlight high-risk annotations, and require sign-off from a security engineer before the marked schema is published to the agent's tool registry. This gate prevents misclassified fields from reaching production tool contracts where agents might mishandle sensitive data.

Finally, integrate the marked schema output into the agent's tool execution layer. The agent framework should read the classification annotations at runtime and enforce data handling rules: fields marked CREDENTIAL must never be logged or stored, PII fields must be redacted from observability traces, and REGULATED fields must trigger retention and access control checks. The prompt's output is not just documentation—it is a machine-readable policy contract that the agent runtime must enforce. Wire the marked schema into your tool proxy or middleware so that classification labels become active guardrails, not passive annotations.

IMPLEMENTATION TABLE

Expected Output Contract

Validate the marked schema output against this contract before integrating it into a data handling pipeline or compliance review workflow.

Field or ElementType or FormatRequiredValidation Rule

marked_schema

object

Top-level object must contain the original schema structure with injected classification annotations.

marked_schema.fields

array

Each field in the original schema must appear with its full definition plus a classification block.

marked_schema.fields[].classification.label

enum: PII | TOKEN | CREDENTIAL | REGULATED | INTERNAL | PUBLIC

Label must exactly match one of the allowed enum values. Reject unknown or misspelled labels.

marked_schema.fields[].classification.rationale

string

Non-empty string citing the specific data element, policy reference, or pattern that triggered the label.

marked_schema.fields[].classification.confidence

number (0.0-1.0)

Must be a float between 0 and 1 inclusive. Values below [CONFIDENCE_THRESHOLD] should trigger human review.

marked_schema.fields[].classification.handling_rule

string

Must contain an actionable directive: REDACT, MASK, ENCRYPT, BLOCK, AUDIT, or ALLOW. Reject empty or vague rules.

marked_schema.compliance_summary

object

Must include total_fields_analyzed, fields_flagged, and policy_version strings. Schema check: all three keys present.

marked_schema.compliance_summary.policy_version

string

Must match the [POLICY_VERSION] input. Mismatch triggers a retry or human escalation.

PRACTICAL GUARDRAILS

Common Failure Modes

What breaks first when marking sensitive data fields in tool schemas and how to guard against it.

01

Silent Classification Gaps

What to watch: The prompt misses sensitive fields because they use non-obvious names like user_ref, ext_id, or payload. The model relies on field name pattern matching rather than semantic analysis of what the data represents. Guardrail: Include a pre-pass that maps all fields to their semantic data categories before classification. Require the prompt to justify each classification decision with a one-sentence rationale that can be audited.

02

Nested Object Blindness

What to watch: Sensitive data hides inside deeply nested objects, arrays of objects, or union-typed fields. The prompt classifies the top-level container but misses PII three levels deep in metadata.custom_fields.internal_notes. Guardrail: Require recursive traversal rules in the prompt. Add a post-processing validation step that flattens the schema and checks every leaf field against the classification output.

03

Over-Classification and Agent Paralysis

What to watch: The prompt marks too many fields as sensitive, including non-sensitive identifiers like product_sku or department_code. This causes downstream agents to refuse legitimate tool calls or trigger unnecessary approval gates. Guardrail: Define explicit exclusion categories with examples. Require the prompt to distinguish between regulated data, business-confidential data, and operational identifiers. Add a human review step for any field marked as the highest sensitivity tier.

04

Output Field Neglect

What to watch: The prompt focuses exclusively on input arguments and ignores response schemas. Sensitive data in tool outputs—like customer_email in a lookup response—passes through unmarked and enters agent context without controls. Guardrail: Require the prompt to process input and output schemas symmetrically. Add a checklist item that verifies every response field has a classification label before the schema is approved for production use.

05

Compliance Policy Drift

What to watch: The prompt applies a static classification policy that doesn't reflect jurisdiction-specific rules, data residency requirements, or updated regulations. Fields that should be marked under GDPR or HIPAA are classified under a generic policy that misses jurisdiction triggers. Guardrail: Include the applicable policy document or regulation reference as a required input. Version the policy alongside the schema. Add a compliance check step that cross-references classification labels against the specific regulatory framework cited.

06

Token and Credential Misclassification

What to watch: API keys, bearer tokens, and session credentials in header-like fields are classified as generic strings instead of credential-bearing fields. The schema passes validation but the agent later logs or stores these values in plaintext. Guardrail: Add explicit credential pattern detection rules that check for common token formats, key prefixes, and authentication header conventions. Flag any field named with token, key, secret, auth, or credential for mandatory review regardless of the model's classification confidence.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the quality and safety of the annotated tool schema before integrating it into an agent harness or compliance pipeline. Each criterion targets a specific failure mode observed in production schema marking.

CriterionPass StandardFailure SignalTest Method

PII Field Coverage

All fields containing direct identifiers (email, name, phone, SSN) are marked with a classification of PII

A known PII field in the input arguments or output response is unmarked or marked as INTERNAL

Diff the marked schema against a manually curated golden list of expected PII fields for the target tool

Credential and Token Detection

All fields containing API keys, bearer tokens, passwords, or session secrets are marked classification: CREDENTIAL and retention: TRANSIENT

A field named api_key or token is marked classification: INTERNAL or retention: PERSISTENT

Regex scan for common credential field names (key, secret, token, password) and verify their classification label in the output

Regulated Data Classification

Fields containing PCI, PHI, or GDPR-sensitive data are marked with the specific regulation tag (e.g., regulation: PCI_DSS)

A credit card number field is marked only as PII without the regulation: PCI_DSS tag

Check for the presence of a regulation array on fields matching known regulated data patterns (PAN, SSN, MRN)

Output Response Marking

Sensitive fields in the tool's output_schema are marked with the same rigor as input_schema fields

The input schema is fully annotated but the output schema contains an unmarked user_email field in a response object

Parse the output schema separately and assert that the count of marked sensitive fields is greater than zero for tools that return user data

Compliance Policy Adherence

The marked schema includes a handling_policy block referencing the organization's data retention and encryption standards

The output contains only field-level tags but omits the top-level handling_policy object required by the prompt

Validate the top-level JSON structure for the presence of a handling_policy key with a non-null value

No Over-Classification

Non-sensitive fields like product_id or quantity are marked classification: PUBLIC or INTERNAL, not PII or CREDENTIAL

A field named timestamp or status_code is incorrectly flagged as PII

Sample 5 non-sensitive fields from the original schema and assert their classification is not in the sensitive category list

Schema Structure Preservation

The output is a valid JSON object that preserves all original tool schema keys, adding only annotation fields

The output is missing required original keys like type or properties from the input schema

Perform a deep-keys comparison between the input schema and the output schema to ensure no structural keys were dropped

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Start with the base prompt and a single schema. Use a lightweight JSON schema validator in your harness rather than full policy engine integration. Replace [DATA_CLASSIFICATION_POLICY] with a short inline list of field types to flag (e.g., PII, credentials, tokens, PHI). Drop the [COMPLIANCE_STANDARD] placeholder and focus on field-level marking only.

Watch for

  • Over-marking: the model flags every string field as sensitive when no real PII exists
  • Missing nested field traversal: flat schemas work, but deeply nested objects with sensitive leaf fields get skipped
  • Inconsistent severity labels when the policy list is too vague
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.