Plugin Documentation

RekognitionGuard
Amazon Rekognition for Blueprints and C++

Moderate player images — avatars, sprays, screenshots and user-generated content — with one node and a clear Allowed / Review / Blocked verdict, and use Rekognition vision (labels, text, faces, face collections, protective equipment, celebrities, stored video) from your game.

v1.0
UE 4.27 & 5.8
Win64, Linux & Android
75 Blueprint nodes
Category Networking
Alpha XP

Overview

RekognitionGuard connects Unreal Engine 4.27 and 5.8 to Amazon Rekognition. Its core is UGC moderation: hand it a texture, a render target, a screenshot, a file, bytes or an S3 object and it fires On Allowed, On Review or On Blocked, with the reasons. Requests and image encoding run on background worker threads; every result arrives on the game thread.

  • Is Image Safe, Moderate Texture, Moderate Render Target, Moderate Screenshot: one node from player content to a verdict.
  • Moderation policies with category rules and thresholds, presets (All Ages, Teen, Mature), lenient mode for drawings, video verdicts with timestamps.
  • Image input from bytes, files, UTexture2D (also compressed and streamed textures), UTextureRenderTarget2D, the game viewport and S3; JPEG encoding with the engine ImageWrapper; automatic downscaling under the 5 MB limit.
  • Vision: labels with boxes, dominant colours and image quality, text, faces with attributes, face comparison, protective equipment, celebrities.
  • Face collections and users: index, search, list, delete, associate — for duplicate-account checks, ban evasion detection or face sign-in.
  • Stored video (S3): content moderation and label detection jobs, with Wait For ... nodes that poll and collect every page.

Requirements

RequirementDetails
Unreal Engine4.27 and 5.8
PlatformsWin64, Linux and Android
ModulesRekognitionGuard (Runtime), RekognitionGuardSdk (prebuilt AWS SDK for C++ 1.11.916 in Source/ThirdParty)
DependenciesNo other plugins. Engine modules ImageWrapper, RenderCore and RHI. On Linux and Android the SDK uses the engine's libcurl, OpenSSL and certificate store.
AWSAn AWS account in a region where Amazon Rekognition is available. Rekognition usage is billed by AWS per image / per minute of video.

Installation

  1. Install RekognitionGuard from Fab into your engine, or copy the RekognitionGuard folder into your project's Plugins folder.
  2. Enable RekognitionGuard in Edit > Plugins and restart the editor.
  3. Open Project Settings > Plugins > RekognitionGuard and set Region and Identity Pool Id.
  4. C++ only: add PublicDependencyModuleNames.Add("RekognitionGuard"); to your Build.cs.
Several AWS plugins in one projectEach Alpha XP cloud plugin carries its own copy of the SDK under a plugin-specific name, so they install side by side without conflicts.

Setting up AWS

  1. In Amazon Cognito create an identity pool in your Rekognition region. Enable guest access if players may submit images before signing in.
  2. Give the role the pool hands to players only the image analysis calls the game needs. Collection writes (Index Faces, Create User, Delete ...) and video jobs belong on a server or a tool with its own role.
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "PlayerImageChecks",
      "Effect": "Allow",
      "Action": [
        "rekognition:DetectModerationLabels",
        "rekognition:DetectLabels",
        "rekognition:DetectText",
        "rekognition:DetectFaces",
        "rekognition:CompareFaces",
        "rekognition:DetectProtectiveEquipment"
      ],
      "Resource": "*"
    },
    {
      "Sid": "SearchOneCollection",
      "Effect": "Allow",
      "Action": ["rekognition:SearchFacesByImage", "rekognition:SearchUsersByImage"],
      "Resource": "arn:aws:rekognition:us-east-1:123456789012:collection/mygame-players"
    }
  ]
}

Server / tool role, in addition: rekognition:CreateCollection, DeleteCollection, DescribeCollection, ListCollections, IndexFaces, ListFaces, DeleteFaces, SearchFaces, CreateUser, DeleteUser, ListUsers, AssociateFaces, DisassociateFaces, SearchUsers, RecognizeCelebrities, GetCelebrityInfo, StartContentModeration, GetContentModeration, StartLabelDetection, GetLabelDetection. Images and videos in S3 need s3:GetObject on the objects for the caller; video jobs with an SNS topic need iam:PassRole for the topic role.

Never ship access keysStatic keys in the settings end up in DefaultGame.ini and in packaged games. Use them only for development and dedicated servers; players should always use the identity pool. Shipping builds refuse settings keys unless Allow Static Keys In Shipping is enabled.
PrivacyFace collections store face vectors (not images) that identify people. Ask players for consent, explain the purpose, and call Delete Faces / Delete User when an account is deleted. Check the laws of your players' countries before using face search.

Quick start

Moderate an avatar

  1. Get the picture: a texture the player picked (Moderate Texture), a file (Load Image File then Is Image Safe) or bytes from an HTTP upload (Make Image From Bytes then Is Image Safe).
  2. Leave Policy unconnected to use the settings preset (Teen by default), or connect Make Moderation Policy.
  3. On Allowed: upload Image > Bytes (already JPEG and under 5 MB). On Review: hide it until a moderator looked at it; log Verdict To Text. On Blocked: tell the player; Verdict > Reasons lists the labels.

Moderate a spray canvas

Players paint into a render target. Before replicating it, call Moderate Render Target with the canvas. Set Lenient For Illustrations in the policy so drawings are reviewed rather than blocked at the same confidence. Add Detect Text + Get Text Lines to run written words through your own word filter.

Profile photo check

Detect Faces with Attributes = All, then Check Profile Photo: one sharp, bright, frontal face without sunglasses; Problems holds player-friendly messages.

Images

SourceHow it is read
Bytes / fileJPEG and PNG up to 5 MB are sent unchanged. Other formats (BMP, TGA, EXR...) and larger files are decoded with the engine ImageWrapper and re-encoded as JPEG.
UTexture2D1) editor source art (BGRA8, G8, RGBA16), 2) uncompressed platform data still in CPU memory (B8G8R8A8, R8G8B8A8, G8 - typical for textures created at runtime), 3) otherwise the texture is drawn into a temporary render target (works for compressed and streamed textures; needs a world context).
UTextureRenderTarget2DPixels read on the game thread (rendering commands are flushed), JPEG encoding on a worker thread.
ScreenshotThe engine's in-memory screenshot (FScreenshotRequest + UGameViewportClient::OnScreenshotCaptured); no file is written. Needs a game viewport (PIE or a packaged game).
S3Bucket + key (+ version) in the Rekognition region; Rekognition reads the object directly.

Captured images are downscaled so the longer side is at most Max Image Dimension (2048 px) and encoded at Jpeg Quality (85); if the JPEG is still above 5 MB the quality and then the size are reduced until it fits. Every node returns or works on exactly the bytes that were sent.

Moderation policies

Rekognition returns moderation labels in a three-level taxonomy (version 7). The 10 top-level categories are: Explicit, Non-Explicit Nudity of Intimate parts and Kissing, Swimwear or Underwear, Violence, Visually Disturbing, Drugs & Tobacco, Alcohol, Rude Gestures, Gambling, Hate Symbols. Get Moderation Categories lists them and their level-2 labels.

A policy is a list of rules Category, Action (Ignore / Review / Block), Min Confidence plus an action for unlisted labels. Evaluation: only the most specific detected labels are judged (a parent is skipped when one of its children was detected); for each, the closest category in its chain (label, parent, top-level) that has rules decides; among those rules the strongest one whose confidence is reached wins. So Weapons: Review 60 overrides Violence: Block 80 for a weapon, while graphic violence still follows the Violence rule.

PresetBlocksReviews
All Agesevery category from 50-60 % (swimwear from 85 %)swimwear 50-85 %, unlisted labels from 60 %
Teenexplicit 75 %, hate symbols 75 %, graphic violence 85 %, death and emaciation 80 %, non-explicit nudity 90 %explicit and hate symbols from 50 %, violence / weapons 70 %, disturbing 70 %, drugs 70 %, gestures 70 %, alcohol / gambling / swimwear 80 %; kissing is ignored
Matureexplicit sexual activity 85 %, hate symbols 80 %explicit 60 %, hate symbols 50 %, visually disturbing 85 %; the rest is ignored
Start strict, tune with dataLog Verdict To Text for every Review and Blocked image during a playtest, look at the false positives, and adjust thresholds in your own policy (Make Moderation Policy, then edit the Rules array).

Node reference (75)

Latent nodes run in the background, can be stopped with Cancel on their return value and fire exactly one final pin on the game thread. Collection Id empty = Default Collection Id; thresholds 0 = Default Face Match Threshold.

Config and identity

NodeKindInputsOutputsPurpose
Set RegionCallRegion-Switches the AWS region for every following request.
Set Credential ModeCallMode-Overrides the credential mode from the settings.
Set Login TokenCallProvider, Token-Signs the player in to the identity pool with a provider token.
Clear Login TokensCall--Forgets logins; the player becomes a guest.
Set Static CredentialsCallAccess Key Id, Secret Access Key, Session Token-Static keys from now on (development, servers, keys from your backend).
Get Identity IdPure-Identity IdThe player's Cognito identity id.
Make User Pool Provider NamePureRegion, User Pool IdProvidercognito-idp.<region>.amazonaws.com/<pool id>.
Is ConfiguredPure-bool, ProblemFalse with a reason when the settings are incomplete.
Resolve IdentityLatentForce RefreshOn Success / On Failure (Identity Id, Error)Fetches credentials ahead of the first request.
CancelCall(latent node)-None of the node's pins fire any more.
Is FinishedPure(latent node)boolTrue after the node finished or was cancelled.

Images

NodeKindInputsOutputsPurpose
Image From TextureLatentTextureOn Success / On Failure (Image, Error)Encodes a texture as JPEG (source, CPU data or a canvas render).
Image From Render TargetLatentRender TargetOn Success / On Failure (Image, Error)Reads and encodes a render target.
Capture ScreenshotLatentShow UIOn Success / On Failure (Image, Error)In-memory viewport screenshot as JPEG.
Load Image FileLatentFile PathOn Success / On Failure (Image, Error)Loads, converts and downscales an image file on a worker.
Make Image From BytesPureBytesImageWraps encoded bytes; reads width / height from the JPEG / PNG header.
Make S3 ImagePureBucket, Key, VersionImageAn image stored in S3.
Get Image FormatPureImageFormatJPEG, PNG, Other (converted) or Unknown.
Is Image ValidPureImagebool, ProblemChecks that the image can be sent.
Bounding Box To PixelsPureBox, Image Width, Image HeightTop Left, SizeNormalized box to pixels, for UMG overlays.

Moderation

NodeKindInputsOutputsPurpose
Is Image SafeLatentImage, PolicyOn Allowed / On Review / On Blocked / On Failure (Verdict, Image, Error)Moderates an image against a policy.
Moderate TextureLatentTexture, Policysame as Is Image SafeCaptures and moderates a texture.
Moderate Render TargetLatentRender Target, Policysame as Is Image SafeCaptures and moderates a render target (sprays, drawings).
Moderate ScreenshotLatentPolicy, Show UIsame as Is Image SafeTakes and moderates a screenshot (photo mode, sharing).
Detect Moderation LabelsLatentImage, Min Confidence, Max Taxonomy LevelOn Success / On Failure (Result, Error)Raw moderation labels, content types (animated / illustrated) and model version.
Evaluate ModerationPureLabels, Policy, Content TypesVerdictThe UGC verdict evaluator (local, instant).
Evaluate Video ModerationPureTimed Labels, PolicyVerdictVerdict for a video; reasons carry the frame timestamps.
Combine VerdictsPureVerdictsVerdictThe strictest of several verdicts, reasons merged.
Verdict To TextPureVerdictText"Blocked: Explicit Nudity 97%, Weapons 88%".
Make Moderation PolicyPurePresetPolicyAll Ages, Teen or Mature.
Get Moderation CategoriesPureParentNamesTop-level categories, or the level-2 labels of one.
Get Top Level CategoryPureLabel, All LabelsCategory"Weapons" -> "Violence".
Filter Moderation LabelsPureLabels, Max Taxonomy Level, Min ConfidenceLabelsKeeps labels up to a level and confidence.
Set Default Moderation PolicyCallPolicy-Default for nodes whose Policy has no rules (until the game ends).
Get Default Moderation PolicyPure-PolicyThe runtime default, else the settings preset.

Vision

NodeKindInputsOutputsPurpose
Detect LabelsLatentImage, OptionsOn Success / On Failure (Result, Error)Objects, scenes, concepts with boxes; optional image quality and dominant colours; include / exclude filters.
Detect TextLatentImage, OptionsOn Success / On Failure (Text, Error)Lines and words with boxes and polygons; word filter and regions of interest.
Detect FacesLatentImage, AttributesOn Success / On Failure (Faces, Error)Faces with age range, emotions, eyes open, smile, glasses, pose, quality, landmarks.
Compare FacesLatentSource, Target, Similarity Threshold, QualityOn Success / On Failure (Result, Error)Is the face of Source in Target?
Detect Protective EquipmentLatentImage, Required Equipment, Min ConfidenceOn Success / On Failure (Result, Error)Persons and their face / head / hand covers, with a summary.
Recognize CelebritiesLatentImageOn Success / On Failure (Celebrities, Unrecognized Faces, Error)Public figures in an image (impersonation checks).
Get Celebrity InfoLatentCelebrity Idsame as Recognize CelebritiesName, links and known gender of a celebrity id.
Get Top LabelPureLabelsbool, LabelThe most confident label.
Filter Labels By ConfidencePureLabels, Min ConfidenceLabelsLabels at or above a confidence, best first.
Find LabelPureLabels, Name, Include Relatedbool, LabelA label by name, optionally via parents / aliases.
Get Labels In CategoryPureLabels, CategoryLabelsLabels of one label category.
Count ObjectsPureLabels, Name, Min ConfidenceCountNumber of located instances (for example people).
Get Text LinesPureDetections, Min Confidence, WordsLines, Full TextText in reading order.
Get Dominant EmotionPureFacebool, Emotion, ConfidenceThe strongest emotion of a face.
Get Largest FacePureFacesbool, Face, IndexThe face closest to the camera.
Check Profile PhotoPureFaces, Requirementsbool, ProblemsAvatar / profile photo rules with player-friendly messages.
Check Required EquipmentPurePerson, Required, Min Confidencebool, MissingDoes a person wear every required item?

Face collections and users

NodeKindInputsOutputsPurpose
Create CollectionLatentCollection Id, TagsOn Success / On Failure (Collection, Error)Creates a face collection (server / admin).
Delete CollectionLatentCollection IdsameDeletes a collection and its faces.
Describe CollectionLatentCollection IdsameFace / user count, model version, ARN, creation time.
List CollectionsLatentMax Results, Next TokenOn Success / On Failure (Collections, Next Token, Error)Collections of the account.
Index FacesLatentCollection Id, Image, External Image Id, Attributes, Max Faces, QualityOn Success / On Failure (Result, Error)Adds faces to a collection.
Search Faces By ImageLatentCollection Id, Image, Max Faces, Threshold, QualityOn Success / On Failure (Result, Error)Finds stored faces matching the largest face of an image.
Search FacesLatentCollection Id, Face Id, Max Faces, ThresholdsameFinds stored faces matching a stored face.
List FacesLatentCollection Id, User Id, Max Results, Next TokenOn Success / On Failure (Faces, Next Token, Error)Faces of a collection (optionally of one user).
Delete FacesLatentCollection Id, Face IdsOn Success / On Failure (Result, Error)Removes faces.
Create UserLatentCollection Id, User IdOn Success / On Failure (User Id, Error)Creates a user (one per player).
Delete UserLatentCollection Id, User IdsameDeletes a user.
List UsersLatentCollection Id, Max Results, Next TokenOn Success / On Failure (Users, Next Token, Error)Users with status.
Associate FacesLatentCollection Id, User Id, Face Ids, ThresholdOn Success / On Failure (Result, Error)Links faces to a user.
Disassociate FacesLatentCollection Id, User Id, Face IdssameUnlinks faces from a user.
Search Users By ImageLatentCollection Id, Image, Threshold, Max Users, QualityOn Success / On Failure (Result, Error)Users matching the largest face of an image.
Search UsersLatentCollection Id, User Id, Face Id, Threshold, Max UserssameUsers similar to a user or a stored face.
Make Safe IdPureTextIdA valid collection / user / external image id from any text.

Stored video (S3)

NodeKindInputsOutputsPurpose
Start Content ModerationLatentOptionsOn Success / On Failure (Job Id, Error)Starts moderation of an S3 video.
Get Content ModerationLatentJob Id, Max Results, Next Token, Sort ByOn Success / On Failure (Job, Error)One page of status and timed labels.
Wait For Content ModerationLatentJob IdsamePolls until the job ends and returns all pages.
Start Label DetectionLatentOptions, Include Labels, Exclude LabelsOn Success / On Failure (Job Id, Error)Starts label detection of an S3 video.
Get Label DetectionLatentJob Id, Max Results, Next Token, Sort ByOn Success / On Failure (Job, Error)One page of status and timed labels.
Wait For Label DetectionLatentJob IdsamePolls until the job ends and returns all pages.

Types

TypeKindMembers
FRekognitionGuardImageStructBytes, S3 Bucket, S3 Key, S3 Version, Width, Height
FRekognitionGuardVerdictStructVerdict, Reasons (Label, Matched Category, Top Category, Confidence, Action, Timestamp Ms), Top Category, Max Confidence, Labels, Content Types
FRekognitionGuardModerationPolicyStructRules (Category, Action, Min Confidence), Unlisted Action, Unlisted Min Confidence, Request Min Confidence, Lenient For Illustrations
FRekognitionGuardModerationLabelStructName, Parent Name, Confidence, Taxonomy Level
FRekognitionGuardLabel / LabelsResultStructName, Confidence, Instances (box, colours), Parents, Aliases, Categories / Image Properties (quality, dominant colours, foreground, background)
FRekognitionGuardTextDetectionStructText, Type, Id, Parent Id, Confidence, Bounding Box, Polygon
FRekognitionGuardFaceDetailStructBox, Confidence, Age Low/High, Smile, Eyeglasses, Sunglasses, Beard, Mustache, Eyes Open, Mouth Open, Face Occluded, Gender, Emotions, Landmarks, Roll/Yaw/Pitch, Brightness, Sharpness, Eye Direction
FRekognitionGuardCollection, Face, IndexResult, SearchResult, User, UserSearchResult, FaceBatchResultStructFace collection data
FRekognitionGuardVideoJobOptions, ModerationJob, LabelJobStructS3 video, notification channel, job tag; status, video metadata, timed labels, next token
FRekognitionGuardErrorStructCode, Message, Http Status, Retryable

Settings

Project Settings > Plugins > RekognitionGuard (saved to DefaultGame.ini). Changes apply to the next request.

SettingDefaultDescription
Regionus-east-1Region of Rekognition, your buckets and identity pool.
Credential ModeCognito Identity PoolCognito Identity Pool, Static Keys or Default Credential Chain.
Identity Pool Id / Allow Guest Access(empty) / OnCognito identity pool for players.
Access Key Id / Secret Access Key / Allow Static Keys In Shipping(empty) / OffStatic Keys mode - development and servers only.
Endpoint Override, timeouts, Max Retries, Worker Threads, Verify SSL, Log Sdk Warnings- / 30000, 5000 / 3 / 4 / On / OnConnection options.
Default Policy PresetTeenPolicy for moderation nodes whose Policy has no rules.
Jpeg Quality85Encoding quality of captured / converted images.
Max Image Dimension2048Longest side of captured / converted images.
Screenshot Timeout Seconds5How long screenshot nodes wait for the viewport.
Default Collection Id(empty)Collection used when a node's Collection Id is empty.
Default Face Match Threshold80Similarity used when a node's threshold is 0.
Video Poll Interval Seconds / Video Wait Timeout Seconds10 / 1800Wait For ... video nodes.

C++

// Build.cs: PublicDependencyModuleNames.Add("RekognitionGuard");
#include "RekognitionGuardAsyncActions.h"
#include "RekognitionGuardLibrary.h"

URekognitionGuardModerateAction* Node = URekognitionGuardModerateAction::IsImageSafe(this,
    URekognitionGuardLibrary::MakeImageFromBytes(UploadBytes), FRekognitionGuardModerationPolicy());
Node->OnAllowed.AddDynamic(this, &UMyUploader::HandleAllowed);   // (Verdict, Image, Error)
Node->OnReview.AddDynamic(this, &UMyUploader::HandleReview);
Node->OnBlocked.AddDynamic(this, &UMyUploader::HandleBlocked);
Node->OnFailure.AddDynamic(this, &UMyUploader::HandleFailure);
Node->Activate();

URekognitionGuardModerationLibrary::EvaluateWithPolicy evaluates labels with exactly the given policy on any thread.

Troubleshooting

Error codeCause and fix
NotConfiguredIdentity Pool Id or Default Collection Id missing in Project Settings > Plugins > RekognitionGuard.
AccessDeniedExceptionThe caller's role lacks the rekognition action (or s3:GetObject for S3 images). See Setting up AWS.
InvalidImageFormatException / InvalidImageFormatThe bytes are not an image; check the upload or the file.
ImageTooLargeExceptionOnly possible for S3 images (bytes are downscaled automatically): S3 images may be up to 15 MB.
InvalidS3ObjectExceptionWrong bucket / key, or the bucket is in another region.
ResourceNotFoundExceptionThe collection, user or job does not exist (or is in another region).
ProvisionedThroughputExceededException, ThrottlingExceptionToo many requests per second; the plugin retries with back-off. Queue uploads or request a quota increase.
CaptureFailedThe texture or render target could not be read (no resource yet, no world context for compressed textures).
NoViewport / TimeoutScreenshots need a rendering game viewport (PIE or a packaged game); video waits gave up after the configured timeout.
UnavailableThe SDK library could not be loaded or the engine is shutting down. Check the Output Log for LogRekognitionGuard errors.

Credits

© 2026 Alpha XP — alphaxp.net · Support: support@alphaxp.net. Includes the AWS SDK for C++ and the AWS Common Runtime (Apache License 2.0). Built for Unreal Engine 4.27 and 5.8.