size-limit-enforcement

Enforce document size, nesting depth, and output volume limits during processing.

836|66|Updated Feb 3, 2025
One-click install
npx skills add https://github.com/kreuzberg-dev/html-to-markdown --skill size-limit-enforcement
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: size-limit-enforcement
Source: https://github.com/kreuzberg-dev/html-to-markdown/tree/main/.ai-rulez/domains/safety-sanitization/skills/size-limit-enforcement
Command: npx skills add https://github.com/kreuzberg-dev/html-to-markdown --skill size-limit-enforcement

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents resource exhaustion and potential denial-of-service attacks by enforcing strict limits on document processing.

Core Features & Use Cases

  • Document Size Validation: Rejects excessively large input documents (default 50MB).
  • Nesting Depth Control: Prevents stack overflows by limiting parsing recursion depth (default 256 levels).
  • Output Size Monitoring: Halts conversion if the output exceeds a defined threshold (default 100MB), preventing excessive resource consumption.
  • Graceful Rejection: Provides clear error messages when limits are breached.

Quick Start

Ensure that the processing of the attached document adheres to the default safety configuration.

Frequently Asked Questions about size-limit-enforcement

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent resource exhaustion when processing large documents?

Prevent resource exhaustion during document processing by enforcing configurable limits on input size, parsing nesting depth, and output volume to halt operations and return errors before resource limits are breached.

What is nesting depth control and how does it prevent stack overflows?

Nesting depth control prevents stack overflows by limiting parsing recursion depth to a configured maximum of 256 levels, halting document processing operations before excessive nesting causes a system crash.

How do I enforce memory limits on document parsing operations?

Enforce memory limits on document parsing by validating input document size and monitoring output data volume against a configurable SafetyConfig, rejecting inputs over 50MB and halting conversions exceeding 100MB.

Does document size validation work for preventing denial-of-service attacks?

Yes, document size validation prevents denial-of-service attacks by rejecting excessively large input documents before processing, enforcing strict size constraints to block payloads designed to exhaust system resources.

Can I configure custom safety limits for output data volume monitoring?

Yes, you can configure custom safety limits for output data volume monitoring using SafetyConfig, adjusting the default 100MB threshold to halt conversion and prevent excessive resource consumption during document processing.

What happens when a document exceeds the configured size or nesting limits?

When a document exceeds configured size or nesting limits, the system provides graceful rejection by returning clear error messages and halting document processing operations immediately to prevent resource exhaustion.