Skip to main content

Input Validator

Enforces message size limits and rate limiting to prevent abuse.

What It Does​

Not every attack is sophisticated. Sometimes the simplest approach is the most effective: flood an agent with so many messages that it falls over, or send a single enormous message designed to overwhelm it. Input Validator protects against both of these by checking two things for every incoming message -- is it too long, and is this user sending too many messages too fast?

Think of it as a bouncer checking the guest list and the fire code. It keeps things orderly so everything else can work properly. Oversized messages can be used to overwhelm your agent or push important instructions out of its memory, and message flooding can disrupt service or run up costs for everyone.

This is one of the simplest guards, but it handles a critical job. By catching volume-based abuse early, it ensures that your other guards -- which analyze the actual content of messages -- can do their work without being overwhelmed.

Why It Matters​

Without size and rate limits, a single user or automated script could monopolize your agent, preventing legitimate users from getting help. Message flooding can run up your AI costs dramatically in a short time, and oversized messages can interfere with other security guards that need to analyze message content.

This guard keeps things fair and predictable. It is useful for every deployment, whether you are running a customer support agent, a code assistant, or an internal tool.

What Gets Caught​

  • Oversized messages — messages that exceed the configured character limit. This can happen with very long code pastes, large data dumps, or intentionally padded messages.
  • Message flooding — sending too many messages too quickly from the same channel, which could indicate automated abuse or a denial-of-service attempt.

What won't trigger it: Normal-length messages and typical conversation pacing. The default limits are generous enough to accommodate long code snippets and detailed questions. If you're hitting limits during legitimate use, you can adjust the thresholds in the dashboard.

Example​

Scenario

An automated script sends 50 messages to an agent in 10 seconds. Input Validator detects the message flooding — the rate exceeds the configured limit for that channel. The messages are rejected before they reach the agent or any other guard. The audit log shows a series of rate_limit_exceeded events with the channel ID and timestamps. Separately, if a user pastes an enormous block of text that exceeds the character limit, the message is rejected with a message_too_large event.

Settings​

SettingWhat It Controls
Max Input LengthThe maximum number of characters allowed in a single message
Rate LimitThe maximum number of messages allowed per channel within a time window

How It Responds​

Messages that exceed either limit are simply rejected -- the agent never sees them. There are no modes for this guard. A message is either within limits or it is not.

If This Guard Blocks You​

  1. Check the audit log. Navigate to Security > Audit Log in the CrabShack dashboard. Filter by Input Validator to find the relevant event. Click on the event row to expand it and see details including which skill and channel triggered it, the session key, and additional context.

  2. Understand the detection. The audit log shows either rate_limit_exceeded (too many messages too quickly from one channel) or message_too_large (a single message exceeded the character limit). For rate limit issues, check whether the source is an automated integration sending messages faster than expected — you may need to add delays or batching in the integration. For message size issues, consider whether the user can break their content into smaller messages, or raise the limit if your use case genuinely requires very large messages (like code review agents processing entire files).

  3. Adjust if needed. Adjust the Max Input Length or Rate Limit settings in the dashboard if the defaults are too restrictive for your use case. This guard doesn't have modes — messages either pass or are rejected. See the Configuration page for details.

tip

Prefer creating a targeted exemption for a specific skill or channel over disabling the guard entirely. If you're seeing frequent false positives, a suppression lets you silence a specific detection label temporarily while you refine your settings.

Default Behavior​

The guard ships with generous limits that accommodate normal use for the vast majority of deployments. You should only need to adjust them if you have channels that legitimately handle very large messages (such as code review agents processing entire files) or very high message volumes. During lockdown, the limits tighten automatically to provide stronger protection.

  • Prompt Injection -- Handles content-based threats, complementing Input Validator's volume-based protection.