AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Fstring Html Safety

skill-pattyboi101-oats-autonomous-agents-fstring-html-safety · by Pattyboi101

XSS prevention and HTML safety patterns for Your Project's f-string templates. Use when writing or reviewing any route file that renders HTML.

No reviews yet
0 installs
14 views
0.0% view→install

Install

$ agentstack add skill-pattyboi101-oats-autonomous-agents-fstring-html-safety

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-pattyboi101-oats-autonomous-agents-fstring-html-safety)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Fstring Html Safety? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

F-String HTML Safety — Frontend Department

You are responsible for preventing XSS vulnerabilities in Your Project's f-string HTML templates. Every route file renders HTML via Python f-strings — this is powerful but dangerous if user data isn't escaped.

Before Starting

Check:

  • Does this route display ANY user-supplied data? (tool names, descriptions, search queries, usernames)
  • Are there any f'{variable}' patterns without escape()?
  • Is JSON-LD being injected? (needs json.dumps(), not escape())

How This Skill Works

Mode 1: Writing New Templates

Follow the rules below when creating any new f-string HTML.

Mode 2: Reviewing Existing Code

Grep for unescaped injections: {variable} in HTML context without escape().

Mode 3: Fixing XSS Bugs

When a vulnerability is found, apply the minimal fix (add escape()) without restructuring.

Core Rules

1. Always escape user data

from html import escape
name = escape(tool['name'])  # BEFORE injecting
html = f'{name}'

2. Never hardcode hex colors

# BAD — violates design system
style="color:#00D4F5"

# GOOD — uses CSS variable
style="color:var(--accent)"

All CSS variables are in components.py :root block.

3. Touch targets >= 44px

# Every clickable element needs this for mobile
style="min-height:44px;padding:10px 16px;box-sizing:border-box;"

4. No button inside link

# BAD — invalid HTML
f'Click'

# GOOD — style the link as a button
f'Click'

5. Python 3.11 f-string limitations

# BAD — backslash in f-string expression
f'{value.replace("x", "y")}'

# GOOD — pre-compute
cleaned = value.replace("x", "y")
f'{cleaned}'

6. JSON-LD uses json.dumps, not escape

import json
schema = {"@type": "FAQPage", "name": tool_name}  # raw strings OK
json_ld = json.dumps(schema)  # json.dumps handles escaping
html = f'{json_ld}'

Proactive Triggers

  • New route file created → Check every {variable} in HTML for escape()
  • User input in URL params → request.query_params values MUST be escaped before rendering
  • Tool descriptions displayed → Always escape (makers can put anything in descriptions)
  • Search query shown back to user → Escape the query text in results header

Output Artifacts

| Request | Deliverable | |---------|------------| | "Review route for XSS" | List of unescaped injections with file:line | | "Fix XSS in file X" | Minimal escape() additions, syntax verified | | "New template for page" | Clean f-string HTML following all 6 rules |

Gotchas (from real experience)

  • The security audit on 2026-03-30 found NO confirmed XSS — but that's because most tool data comes from our own ingestion, not user input. As maker-submitted content grows, XSS risk increases.
  • html.escape() is sufficient for HTML text content. For attribute values, also escape quotes: escape(value, quote=True).
  • CSS variable names cannot be injected (they're in :root) but CSS VALUES from user data could be. Never put user data in style="" attributes without sanitization.

Verification

After every edit: python3 -c "import ast; ast.parse(open('file.py').read())"

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.