MCPcopy Create free account
hub / github.com/Emmimal/control-layer / sanitize

Method sanitize

control_layer.py:285–290  ·  view source on GitHub ↗
(self, user_input: str)

Source from the content-addressed store, hash-verified

283 return ValidationResult(passed=True, score=1.0)
284
285 def sanitize(self, user_input: str) -> str:
286 text = user_input.strip()
287 text = re.sub(r"\s+", " ", text)
288 # Strip null bytes and non-printable control chars (except newline/tab)
289 text = re.sub(r"[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]", "", text)
290 return text
291
292
293# =============================================================================

Callers 3

runMethod · 0.80

Calls

no outgoing calls