The gateway calls YepShield once per message, synchronously, and performs the action in the answer. YepShield is always the HTTP server on the message path. The gateway never has to be reachable from YepShield.
The call
POST /shield/v1/screen carries a JSON body and a bearer token. The token identifies the tenant, which is the operator. Calls are idempotent on the message ID, so a retry within a short window returns the stored answer.
Outbound messages are screened before the gateway accepts them from the customer. Inbound messages are screened before delivery.
Request
The request has three parts: who is asking, the message, and where it came from.
{
"gateway": {"name": "yepmsg", "node": "gw-1", "contract": "1.3",
"can": ["rewrite", "reject", "deadend", "throttle", "hold"]},
"sms": {
"sms_type": 2,
"id": "11111111-2222-4333-8444-555566667777",
"sender": "ExampleBank", "receiver": "447700900123",
"msgdata": "Your account is locked. Verify at example.com/verify",
"coding": 0,
"msgdata_b64": "...", "udhdata_b64": ""
},
"ingress": {"kind": "esme", "id": "customer-1", "class": "a2p",
"country": "GB", "international": false, "authorised": true}
}
| Part | Content |
|---|---|
gateway | Name, node, contract version and the actions the gateway implements |
sms | The message exactly as the gateway sends it to its routing hook, plus PDU fields where known |
ingress | What the gateway knows about the source: customer bind, carrier connector, peer or API; its class hint, country, whether it is an international route, whether it is under a formal A2P agreement, agreed identification attributes and any integrity problem the gateway saw |
The ingress comes from the gateway's provisioning. YepShield decides the final traffic class.
Answer
{
"shield": {
"id": "shd_01JCA7Q9ZK2M8E4R6T0VXWYZ3N",
"verdict": "block", "action": "deadend", "mode": "enforce",
"score": 0.97, "category": "smishing", "class": "a2p", "traceable": true,
"reasons": ["brand.lookalike", "content.phrase"],
"policy_revision": "p42"
}
}
The gateway stamps id on the message and its record and passes the answer to its routing hook. It acts on action only. The verdict, score, category and reasons are informational and recorded.
Actions
| Action | Outbound | Inbound |
|---|---|---|
allow | Route as usual | Deliver as usual |
label | Apply the rewrite to the body or sender, then route | Apply, then deliver |
throttle | Answer the customer with a throttling status and no record, so they retry | Not used |
hold | Accept, park and screen again after a delay, until the answer changes or a maximum time passes, then apply a fallback | Not used |
reject | Answer the customer with the given SMPP status. Nothing is routed or billed | Drop, with a record |
deadend | Accept, let routing run so the message can be billed, never deliver. The customer receives a normal acceptance and a receipt according to their mask | Drop, with a record |
drop | Not used | Discard, with a record |
Dead-end is the preferred answer to a malicious sender, who learns nothing from it. A gateway that cannot rewrite, hold or dead-end declares that in the request, and YepShield downgrades the action to the nearest one the gateway can perform and records the downgrade on the decision.
Mode and action
The mode field is the mode the deciding category ran in. In observe mode the action is allow whatever the verdict, and the decision is still recorded. See Policy matrix and modes.
The pipeline
Each decision keeps the ordered steps it went through, with an outcome and a one-line detail for each. The console and the API show the same steps.
- Decode reads GSM 03.38, UCS-2 and binary bodies, and the user data header: concatenation, port addressing, WAP Push and configuration messages.
- Normalise folds look-alike characters, removes zero-width and bidirectional controls and rejoins obfuscated links, and keeps an obfuscation measure as a feature.
- Extract finds links, numbers, amounts and brand mentions.
- Origin works out the traffic class, the sender type and whether the message is traceable.
- Registry resolves the sender against the sender registry.
- Lists and phrases check the message against lists and phrase lists.
- Velocity applies rate and campaign rules.
- Decide applies the policy matrix and mode.
- Record writes the decision and any evidence.
When the screen cannot answer
The gateway's deadline bounds the call. For YepMsg, one attempt is made and the message either passes as unscreened or is refused, depending on the failure mode configured per route. An unscreened message is stamped as such on its record, so reports show what went past unscreened and when. A rate limit answer from YepShield is treated the same way.
Other endpoints
| Endpoint | Purpose |
|---|---|
| Decisions | Read one decision with its steps, or a sender's or receiver's recent decisions. Never returns a body |
| Subscriber lookup | For care centres: messages stopped or labelled towards a number in a period. Never returns a body, and each lookup is audited |
| Appeals | Open and follow a case for a sender or a subscriber |
| Registry export and import | The register of authorised senders as JSON Lines |
| Intelligence export and import | Indicators as JSON Lines, from named sources |
| Health and metrics | Liveness and Prometheus |
Authentication is a bearer token per gateway, and mutual TLS is optional on the hook. The contract specification and a gateway stub for testing are provided on request. Get in touch.