Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Check Bidi Safety

localization.bidi_safety_check

ProductionEngine wrapper (Class A)Deterministicstrictfastv1.0.0
No network

Overview

You send text and a context. We count explicit bidi controls, walk embeddings and isolates, and flag a leftover pop, a deprecated LRO or RLO, a control inside an identifier, or a Trojan-Source pattern in source. Arabic and Hebrew letters without controls stay safe. We do not strip, render or call it malware. A successful call costs 1 execution credit.

Trojan Source and unbalanced isolates change what a reviewer sees. A model cannot prove stack balance from a glance at the string.

Reliability

Same text, same context, same ICU version, same answer. Findings always include utf16Offset and codePointOffset. Structural problems return safe false with diagnostics rather than a typed failure.

Context footprint

One string in. A successful call costs 1 execution credit.

When to use it

When you hold a string and need to know whether its bidi controls are safe for that context.

When you want to generate pseudo-RTL copy, or to detect language.

Powered by ICU4J bidirectional analysis (com.ibm.icu:icu4j).

Scope

Note
Statically flags unbalanced, deprecated or identifier-unsafe bidirectional controls in one string.

Non-goals

  • Does not render the visual order
  • Does not strip or rewrite controls
  • Does not issue a malware verdict

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysisvalidation

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input1 MB

How we handle your data

Sensitive input, safe output
What this means

This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.

Squillify guarantees
  • Runs inside Squillify
  • This skill runs inside Squillify.
  • Payloads are not sent to an external service by this skill.
  • Squillify does not permanently store submitted payloads.
  • Telemetry records metadata only, not submitted content.
  • Submitted payloads are not used for training.
  • Submitted payloads are not reviewed by humans.
  • This skill does not target sensitive data.
  • The response does not contain submitted content.
Your responsibility

Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
textstringYesString to scan for explicit bidirectional controls and unbalanced embeddings.
contextstringYesPLAIN_TEXT, IDENTIFIER or SOURCE_CODE; each applies a different control policy.

Output schema

FieldTypeRequiredDescription
safebooleanYesTrue when every diagnostic is a warning or the list is empty; false when an error exists.
controlCountsobjectYesClosed counts of explicit bidirectional controls: lre rle pdf lro rlo lri rli fsi pdi lrm rlm alm.
diagnosticsarrayYesFrom 0 through 500 diagnostics sorted by path, offset, severity and code; empty when nothing was flagged.
_metaobjectYesClosed ICU and CLDR versions used for this answer, with icuVersion and cldrVersion strings.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"localization.bidi_safety_check","input":{"text":"Hello","context":"PLAIN_TEXT"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("localization.bidi_safety_check", {"context":"PLAIN_TEXT","text":"⁧Hello⁩"});

Errors

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not render the visual order
  • Does not strip or rewrite controls
  • Does not issue a malware verdict
  • Turning English copy into a pseudo-RTL string
  • Detecting the language of a paragraph

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "localization.bidi_safety_check",
  "input": {
    "context": "PLAIN_TEXT",
    "text": "⁧Hello⁩"
  }
}

Examples

Balanced isolate in plain text

Inputjson
{
  "context": "PLAIN_TEXT",
  "text": "⁧Hello⁩"
}
Expected outputjson
{
  "diagnostics": [],
  "safe": true,
  "_meta": {
    "icuVersion": "76.1",
    "cldrVersion": "46.0"
  },
  "controlCounts": {
    "lre": 0,
    "rle": 0,
    "pdf": 0,
    "lro": 0,
    "rlo": 0,
    "lri": 0,
    "rli": 1,
    "fsi": 0,
    "pdi": 1,
    "lrm": 0,
    "rlm": 0,
    "alm": 0
  }
}
Tip
A matched RLI/PDI pair is safe in plain text

Right-to-left override in source

Inputjson
{
  "context": "SOURCE_CODE",
  "text": "if (ok) //‮ {"
}
Expected outputjson
{
  "diagnostics": [
    {
      "code": "DEPRECATED_OVERRIDE",
      "severity": "ERROR",
      "message": "U+202E RIGHT-TO-LEFT OVERRIDE is deprecated.",
      "path": "text",
      "location": {
        "utf16Offset": 10,
        "codePointOffset": 10
      },
      "source": "squillify"
    },
    {
      "code": "TROJAN_SOURCE",
      "severity": "ERROR",
      "message": "A bidirectional embedding, override or isolate can disguise source.",
      "path": "text",
      "location": {
        "utf16Offset": 10,
        "codePointOffset": 10
      },
      "source": "squillify"
    },
    {
      "code": "UNBALANCED_EMBEDDING",
      "severity": "ERROR",
      "message": "A bidirectional embedding or override was never popped.",
      "path": "text",
      "location": {
        "utf16Offset": 10,
        "codePointOffset": 10
      },
      "source": "squillify"
    }
  ],
  "safe": false,
  "_meta": {
    "icuVersion": "76.1",
    "cldrVersion": "46.0"
  },
  "controlCounts": {
    "lre": 0,
    "rle": 0,
    "pdf": 0,
    "lro": 0,
    "rlo": 1,
    "lri": 0,
    "rli": 0,
    "fsi": 0,
    "pdi": 0,
    "lrm": 0,
    "rlm": 0,
    "alm": 0
  }
}
Tip
U+202E in source is unsafe
  • Rejecting a source file that contains U+202E before it is reviewed
  • Allowing Arabic or Hebrew copy that has no bidi controls

Avoid for

  • Turning English copy into a pseudo-RTL string
  • Detecting the language of a paragraph

Composable with

Safety & privacy

  • Runs without calling any external service.
  • Your payloads are never stored permanently.
  • Telemetry captures metadata only — never your payload contents.
  • We never train models on your payloads.
  • No human reviews your payloads.

Tags

bidii18nvalidationtrojan-source