---
slug: "InputGuard"
name: "InputGuard"
type: "Verification"
layer: "Infrastructure"
ref: "InputGuard#0ba7"
sema_id: "sema:InputGuard#mh:SHA-256:0ba715e91627fa1f6759a739da0d4159cac6404c8b45b6e97910d98ef0e8a079"
tags: ["Infrastructure","Verification"]
updated: 2026-11-11
mindscape: "bootstrap"
index_url: https://mindscape.pages.dev/bootstrap/index.json
url: https://mindscape.pages.dev/bootstrap/InputGuard/
related: ["FailClosed","AgentSandbox","DataMinimization","HackDetect","PromptChain","ToolInvoke"]
---

# InputGuard

Input validation and sanitization

Layer: Infrastructure · Category: Verification

## Mechanism

A validation filter that sanitizes inputs before they reach a sensitive component. It enforces schema compliance, type safety, and constraint satisfaction. On violation it applies [FailClosed](https://mindscape.pages.dev/bootstrap/FailClosed.md) behaviour, rejecting the input and logging the attempt.

## Invariants

- Declares the schema or constraint it enforces.
- Names the component it guards.
- No input reaches the guarded component without satisfying that constraint.

## Failure modes

- Bypass via unexpected encoding or type coercion.
- Overly permissive schema allows malformed input through.

## Caution

Validation boundary — bypass enables injection or unexpected state.

## Builds on

- [FailClosed](https://mindscape.pages.dev/bootstrap/FailClosed.md) (Infrastructure; References)

## Used by

- [AgentSandbox](https://mindscape.pages.dev/bootstrap/AgentSandbox.md) (Society; Composes with)
- [DataMinimization](https://mindscape.pages.dev/bootstrap/DataMinimization.md) (Society; References)
- [HackDetect](https://mindscape.pages.dev/bootstrap/HackDetect.md) (Mind; References)
- [PromptChain](https://mindscape.pages.dev/bootstrap/PromptChain.md) (Society; Composes with)
- [ToolInvoke](https://mindscape.pages.dev/bootstrap/ToolInvoke.md) (Infrastructure; Composes with)

## Identity

- Sema ID: `sema:InputGuard#mh:SHA-256:0ba715e91627fa1f6759a739da0d4159cac6404c8b45b6e97910d98ef0e8a079`
- Ref: `InputGuard#0ba7`
- Supersedes:
  - `sema:InputGuard#mh:SHA-256:077022daa9665f3562ad8253b9b6c63ccf7e71d84b74ab48c44e6de421b8bdcb`
  - `sema:InputGuard#mh:SHA-256:fb8233411dd70e49aba71650dccb3ccbf6704261d5e75d2ff0edef6990e415be`
  - `sema:InputGuard#mh:SHA-256:8c3e3319216468f86dc7e8baa97d91f18110bedc30643db39f9deb2ef52a8be9`
  - `sema:InputGuard#mh:SHA-256:f33c7c914e869216a9cd3dcf182648cc9363c46b40d46fc45621145c8878134b`

## Links

- [Pattern page](https://mindscape.pages.dev/bootstrap/InputGuard/)
- [View in the interactive graph](https://mindscape.pages.dev/bootstrap/#InputGuard)
- [JSON](https://mindscape.pages.dev/bootstrap/InputGuard.json)
- [Index of all patterns](https://mindscape.pages.dev/bootstrap/index.json)
