For vendors using Usakey

Seal the files you ship

Encrypt files you ship with your product so that only your app on a device with a valid license can open them.

Plans
Team Enterprise
Who does this
Owner Admin Member

What it can do, and what to know before using it

Encrypt the configuration files, trained models, data files and other files you ship with your product, so that only your app on a device with a valid license can open them. Usakey only receives the short header at the start of each file (which product's key sealed it, the name of the entitlement needed to open it, and so on).

From sealing a file to opening itYou seal files on your own machine with the product's sealing public key and ship them with your product. The file itself is never sent to Usakey. The first time your app opens a file on a device, it checks the license decision and sends only the file's header to Usakey. Usakey checks the license, the entitlement, and your plan, and returns a key that works only on that device. After that, the app opens the file with the stored key without going online, still checking the license decision each time.Your buildYour app(device)UsakeySealing (on your machine)Seal the file with thepublic key (the filenever goes to Usakey)1Ship the .sealed filewith your product2First open on a deviceCheck the licensedecision (and theentitlement)3Send only thefile's header4Check the license,entitlement, and plan5A key for thisdevice only6After thatOpen with thestored key, offline(the decision is stillchecked each time)7From sealing a file to opening itYou seal files on your own machine with the product's sealing public key and ship them with your product. The file itself is never sent to Usakey. The first time your app opens a file on a device, it checks the license decision and sends only the file's header to Usakey. Usakey checks the license, the entitlement, and your plan, and returns a key that works only on that device. After that, the app opens the file with the stored key without going online, still checking the license decision each time.Sealing (on your machine)1Your buildSeal the file with thepublic key (the filenever goes to Usakey)2Your buildYour app (device)Ship the .sealed filewith your productFirst open on a device3Your app (device)Check the license decision(and the entitlement)4Your app (device)UsakeySend only the file's header5UsakeyCheck the license,entitlement, and plan6UsakeyYour app (device)A key for this device onlyAfter that7Your app (device)Open with the stored key,offline (the decision isstill checked each time)
A device receives the key only the first time it opens the file, and opens it offline after that.

What to know before using sealed files

  • An administrator of a licensed device can extract the data from memory or with a debugger after your app opens the file. Sealing does not prevent that.
  • Data that has been extracted can't be taken back.
  • Don't put values your users must never see, such as API keys or passwords, on the device, even sealed. Do the work that needs them on your own server.
  • Sealing your files does not make analysis or cracking impossible; in principle both remain possible. Use sealed files with that understood.
  • Sealing does not prove who made a file. Anyone who knows the sealing key can make a file your product opens. For files that must not be swapped, such as model weights or settings, have the app check a hash of the contents (example).

What it can do

  • Getting hold of what you ship (an installer, a container image, a model file) is not enough to read the contents.
  • Devices without a license, and devices beyond the license's device limit, can't open the files.
  • Seal a file with an entitlement name, and only devices whose license has that entitlement turned on (true) can open it. For example, only Pro licenses can open the high-accuracy model, while Standard licenses get the standard one. An entitlement is a named on/off switch you set on policies and licenses.
  • A device that learns at a periodic check that the license is suspended, revoked or expired can no longer open the files. A device that can't connect keeps opening them until it learns this (during the certificate's validity and the network grace period set in the policy).
  • Changing even one byte of a file, truncating it or adding data to its end stops it from opening.
What sealing a file protectsA sealed file can't be read inside your distribution without a license, and changing even one byte stops it from opening. Your app opens it only after checking the license and the entitlement. But the opened data sits in memory, and the administrator of a licensed device can extract it, so don't put values that must stay hidden on the device. Sealing also doesn't prove who made a file, so check a hash in your app for files that must not be swapped.ProtectedInside thedistribution(.sealed)Unreadablewithout alicense. Won'topen if changedChecked hereYour appopens itAfter checkingthe license andentitlementNot protectedData afteropeningThe device'sadministratorcan extract itfrom memory.Keep secretsoff the deviceSealing doesn't prove who made a file. Check ahash in your app for files that must not be swappedWhat sealing a file protectsA sealed file can't be read inside your distribution without a license, and changing even one byte stops it from opening. Your app opens it only after checking the license and the entitlement. But the opened data sits in memory, and the administrator of a licensed device can extract it, so don't put values that must stay hidden on the device. Sealing also doesn't prove who made a file, so check a hash in your app for files that must not be swapped.ProtectedInside thedistribution (.sealed)Unreadable withouta license. Won'topen if changedChecked hereYour app opens itAfter checking thelicense and entitlementNot protectedData after openingThe device'sadministrator can extractit from memory. Keepsecrets off the deviceSealing doesn't prove whomade a file. Check a hashin your app for files thatmust not be swapped
Sealing protects a file while it sits in your distribution.

Turn on sealed files

  1. Step 1Turn it on from the product page

    Open the product from Products in the left menu, and press Turn on sealed files in the Sealed files section. Read the confirmation message and continue, and it's on right away. Owners, admins and members can do this.

    You can also ask an AI assistant. If its connection has “Allow product, policy, and webhook configuration” under Access to grant, ask “Use the Usakey MCP skill to turn on sealed files for this product and tell me its sealing key” (it can't be turned off afterward, so the AI confirms with you first). If the connection doesn't allow that, the AI will point you to this page.

    Once on, it can't be turned off, because files you have sealed and shipped would stop opening. On the Evaluation plan the section shows Not in your plan and it can't be turned on.

    The sealed files section on the product page. The status is Off, with a note that turning it on shows the public key you seal this product's files with, and a button to turn on sealed files.
  2. Step 2Copy the sealing key

    Once it's on, Sealing key (public) shows one line starting with usakey-sealing-key:v1:. Copy it with Copy key and give it to the sealing tool.

    This line is not a secret, so it can live in your build settings, such as a CI variable. The private key that opens the files never leaves Usakey (in production it stays inside a key management service that never releases the key). The key part of the line is the same for every product in the environment: the environment shares one key, and products are told apart by the product ID and key ID in the line, so another product's app can't open your files. You can get the same line with GET /mgmt/v1/products/{product_id}/sealed-files in the Management API, or with get_product_sealed_files from an AI assistant (MCP).

    The sealed files section after turning it on. The status is On, showing the one-line sealing key (blurred in the image) with a Copy key button, an example sealing-tool command, a note that sealing does not prove who made a file so the app should check a hash, and a note that an administrator of the device can extract the data after the app opens it.

Seal your files

  1. Step 1Seal your files

    The easiest way to seal is to ask your AI assistant. The files are sealed on your own machine and are never sent to Usakey.

    Paste this prompt into your AI assistant. Replace the file name and the entitlement name with your own.

    Use the Usakey MCP skill to seal models/pro.onnx, which ships with my product, so that it opens only on devices with a valid license. Use the sealing key line I copied from this product's page in the Console (it starts with usakey-sealing-key:v1: and I'll paste it here). Only Pro licenses should be able to open it, so give it the entitlement pro_model and write it next to the original as models/pro.onnx.sealed. Keep the original out of what I ship.
  2. Step 2Ship the sealed files with your product

    Put the sealed files in your installer or container image. Don't ship the original files.

    Each file is sealed with its own random key, so sealing the same file again produces a different file. When you ship a newly sealed file, each device fetches its key once more the first time it opens it. To seal files from your build system, you can also use the sealing function in the SDK of every language except iOS / Android (it produces the same format).

Open them in your app

Building this into your app is also easiest with an AI assistant. Connect it the same way as in Add license checks to your app and ask like this. Replace the file name and the entitlement name with your own.

Use the Usakey MCP skill to make this app open models/pro.onnx.sealed with its license. Load it only when the pro_model entitlement is on, and when it can't be used, fall back to the standard model and show the reason.

The AI writes the code that reads the file with the SDK's open-sealed-file function, and tests for it. The official SDK has this function in every language (iOS / Android can only open files). The SDK function works like this.

  • Every time it opens a file, it checks the current license decision and opens the file only when use is allowed. If the file has an entitlement name, the decision is made for that entitlement.
  • Only the first time a device opens a file does it contact Usakey to receive the key (this uses one Runtime API call from the monthly allowance). The device stores the key and opens the file without connecting after that.
  • The SDK never gives your app the key that opens the file; it returns only the opened data.

To build it yourself, see Receive the key for a sealed file in the developer documentation.

Example: a machine-learning model and its preprocessing

This example ships trained weights and preprocessing parameters (feature order, means and standard deviations, the decision threshold, and so on) with the product so that only the product app on a device with a valid license can read them. The SDK's python/examples/sealed_model has a version you can run, from training and sealing to loading and scoring in the app (Python standard library only).

  1. Seal in your build. Write the weights and the preprocessing to files and seal each with the sealing key. Give the high-accuracy model an entitlement (for example pro_model). Ship only the .sealed files.
  2. Pin the plaintext hashes in the app. In the same build, compute the SHA-256 of each file before sealing and embed it in the app's code. A hash doesn't reveal the weights. A fake file made by someone who knows the sealing key opens, but its hash doesn't match, so the app doesn't load it.
  3. Load in memory. Load the data the SDK returns as it is, and never write it to disk, logs or temporary files. Pick formats that load from bytes (ONNX Runtime's InferenceSession(data), safetensors, NumPy .npz without pickle, JSON, and so on).
# Your build (seals with the public key only)
usakey.seal_file(sealing_key, "model.onnx", "dist/model.onnx.sealed", entitlement="pro_model")
usakey.seal_file(sealing_key, "preprocess.json", "dist/preprocess.json.sealed")
print(hashlib.sha256(open("model.onnx", "rb").read()).hexdigest())  # embed in the app

# The product app (checks what it opened, then uses it in memory)
model = client.open_sealed_file("dist/model.onnx.sealed")
if not hmac.compare_digest(hashlib.sha256(model).hexdigest(), MODEL_SHA256):
    raise RuntimeError("This is not the model this app was built with")
session = onnxruntime.InferenceSession(model)
  • A license whose entitlement isn't turned on (true) can't open the high-accuracy model (in Python, LicenseDeniedError with the reason EntitlementMissing). The app can switch to the standard model and keep working.
  • Don't load pickle-based formats (joblib, torch.load by default, and so on) from sealed files. A fake file could make your app run arbitrary code.
  • An administrator of the device can extract the weights from memory after the app loads them. If the weights must never reach devices, run inference on your server instead.

Fully offline devices

Devices without an internet connection can open sealed files too.

  • When the device creates its request file (.usakeyreq), include the sealed files (up to 16 per request). Only the files' headers go into the request file.
  • When you issue the license file (.usakeylic) in the Console or with the Management API, the keys for those files go into it. If the key for even one file can't be delivered, nothing is issued and the reason is shown (a file for another product, an entitlement that isn't true, a plan that doesn't include it, and so on).
  • After loading the license file, the device opens the files without connecting. To add another file later, create a new request file and issue the license file again.
Opening sealed files on a fully offline deviceWhen the device creates its request file (.usakeyreq), include the headers of the sealed files (up to 16 per request). When you issue the license file (.usakeylic) in the console, the keys for those files go into it. Once the device loads the license file, it opens the files without going online.DeviceCreate therequest fileInclude theheaders in the.usakeyreq(up to 16)You (console)Issue thelicense fileThe .usakeyliccarries thefile keysDeviceLoad thelicense fileBring it tothe deviceDeviceOpen offlineTo add files,request againOpening sealed files on a fully offline deviceWhen the device creates its request file (.usakeyreq), include the headers of the sealed files (up to 16 per request). When you issue the license file (.usakeylic) in the console, the keys for those files go into it. Once the device loads the license file, it opens the files without going online.DeviceCreate the request fileInclude the headers inthe .usakeyreq (up to 16)You (console)Issue the license fileThe .usakeyliccarries the file keysDeviceLoad the license fileBring it to the deviceDeviceOpen offlineTo add files, request again
A fully offline device gets the keys inside its license file. To add files later, create a new request file.

In the Console, open the license, choose the request file under Use on a device that cannot connect to the Internet, and select Issue offline license file.

The Use on a device that cannot connect to the Internet section of a license page, with three steps from exporting the request file to importing the license file, a note that license files for this policy are valid for 365 days from issue, a selected request file (.usakeyreq), and the Issue offline license file button.

How to exchange request and license files is in Steps for fully offline devices in the developer documentation.

Wrap an executable

You can bundle a built executable for Linux, Windows, or macOS and its required libraries and data into one executable without changing the code. usakey-wrap encrypts the original program using the same method as above and adds a launcher at the beginning of the executable. On the user's device, the launcher decrypts and runs the program only when the license allows it. It preserves the original program's arguments, input, output, and exit code.

Wrapping an executable so the license protects itOn your own machine, you wrap a finished executable with usakey-wrap, without changing its code. The original program is sealed the same way as files, and a launcher is put in front of it, making one executable. On the user's device, the launcher checks the license each time it starts. The first time, it activates the device with the license key. Only when the license decision allows it does the launcher decrypt and run the original program, passing arguments, standard streams, and the exit code straight through. Otherwise it doesn't start the program and shows the reason. Linux runs the program from memory without writing the plaintext to disk, while macOS and Windows write it to a user-only temporary file and delete it on exit. Wrapping alone protects less than embedding the SDK, and only node-locked licenses are supported.The wrappedexecutable (one file)On your machineThe originalexecutableLinux, Windows,or macOS. Itscode stays as it isLauncherChecks the licenseSealed originalprogramSealed the sameway as filesusakey-wrap packtakes the Sealingkey (public), the APIURL, the root publickey, and optionallyan entitlementOn the user's device, at each startCheck the licenseThe first time, activate thedevice with the license keyShipIf allowedDecrypt andrun the originalprogramArguments,streams, andexit code passstraight throughIf notDon't startShow thereasonLinux starts the programwithout writing the plaintext todisk. macOS and Windows writeit to a user-only temporary fileand delete it on exit.Wrapping alone protects less than embedding the SDK in yourprogram. Only node-locked licenses are supported (not floating ones).Wrapping an executable so the license protects itOn your own machine, you wrap a finished executable with usakey-wrap, without changing its code. The original program is sealed the same way as files, and a launcher is put in front of it, making one executable. On the user's device, the launcher checks the license each time it starts. The first time, it activates the device with the license key. Only when the license decision allows it does the launcher decrypt and run the original program, passing arguments, standard streams, and the exit code straight through. Otherwise it doesn't start the program and shows the reason. Linux runs the program from memory without writing the plaintext to disk, while macOS and Windows write it to a user-only temporary file and delete it on exit. Wrapping alone protects less than embedding the SDK, and only node-locked licenses are supported.The wrappedexecutable (one file)On your machineThe original executableLinux, Windows, or macOS.Its code stays as it isLauncherChecks the licenseSealed originalprogramSealed the sameway as filesusakey-wrap pack takesthe Sealing key (public),the API URL, the rootpublic key, andoptionally an entitlementOn the user'sdevice, at each startCheck the licenseThe first time, activate thedevice with the license keyShipIf allowedDecrypt and run theoriginal programArguments, streams,and exit code passstraight throughIf notDon't startShow the reasonLinux starts the programwithout writing theplaintext to disk. macOSand Windows write it toa user-only temporaryfile and delete it on exit.Wrapping alone protectsless than embedding theSDK in your program.Only node-lockedlicenses are supported(not floating ones).
A wrapped executable decrypts and runs only when the license decision allows it.
usakey-wrap pack --key <sealing key> --api-url https://usakey.jp \
  --root-public-key ./usakey-root.pem [--entitlement pro] <executable>

For several files, pass an input folder and an entrypoint relative to it. This example bundles the whole folder. Add --include bin/myapp --include lib --include data to select files or subfolders. Keep the output outside the input folder.

usakey-wrap pack --bundle --entrypoint bin/myapp \
  --key <public sealing key> --api-url https://usakey.jp \
  --root-public-key ./usakey-root.pem --entitlement pro \
  --license-env MYAPP_LICENSE --license-prompt \
  --out dist/myapp build/myapp

You can also ask an AI assistant to do this. The local MCP tool usakey_wrap_pack uses the CLI to bundle the files. The hosted MCP executable-wrapper prompt and skill describe the steps to run locally. The hosted MCP server cannot read your files, so use an assistant that has access to them.

Use the Usakey executable-wrapper prompt and skill to bundle the whole root /work/build/myapp. Set entrypoint to bin/myapp, output to /work/dist/myapp, api_url to https://usakey.jp, root_public_key_path to /work/usakey-root.pem, sealing_key to this product's get_product_sealed_files current_key.sealing_key, entitlement to pro, license_env to MYAPP_LICENSE and license_prompt to true. Use usakey_wrap_pack on the local MCP, or run the CLI locally when using hosted MCP. Check startup and cleanup with a test license.

Before you use it

  • Wrapping alone gives lower crack resistance than embedding the SDK in your program. Use it as a quick way to add a minimum of protection.
  • The launcher's tamper and debugger checks are auxiliary only. A user who controls their own machine can defeat them, and can read the decrypted contents from memory (the same limit as for any sealed file).
  • On Linux, single-file mode starts the program from memory without writing plaintext to disk. Bundle mode extracts files to a dedicated temporary directory on every OS. macOS and Windows also use a temporary file in single-file mode. The launcher restricts access to the current user and removes the temporary files when the program exits normally. If the program is forcibly stopped, temporary files may remain.
  • The bundle working directory is the extracted root. Relative layout, arguments, environment and standard streams are preserved. Expanded contents are limited to 512 MiB and 10,000 entries. Unsafe paths, duplicates and symlinks are rejected. Run the entrypoint in the foreground.
  • On Windows, opening a downloaded executable that is not signed shows SmartScreen's "Windows protected your PC". Sign the executables you distribute with a code signing certificate.
  • Node-locked licenses are supported; floating (concurrent-seat) licenses are not supported yet.

Full usage is in the usakey-wrap README shipped with the SDK.

When a file doesn't open

What your app receives and what to check. None of these deactivates the device.

When a sealed file opensA sealed file opens only when all of these hold. The license can be used (not suspended, revoked, or expired). The entitlement attached to the file is true for that license. Your plan includes file sealing (Team plan or higher). The file was sealed with this product's public key and hasn't been changed. If any of them is missing, the file doesn't open, but the device's activation is never removed.The license can be used (notsuspended, revoked, or expired)The file's entitlementis true for this licenseYour plan includes filesealing (Team or higher)Sealed with this product'skey and unchangedOpensGets the keythe first timeDoesn't openDevice staysactivatedAll trueAnymissingWhen a sealed file opensA sealed file opens only when all of these hold. The license can be used (not suspended, revoked, or expired). The entitlement attached to the file is true for that license. Your plan includes file sealing (Team plan or higher). The file was sealed with this product's public key and hasn't been changed. If any of them is missing, the file doesn't open, but the device's activation is never removed.The license can beused (not suspended,revoked, or expired)The file's entitlementis true for this licenseYour plan includes filesealing (Team or higher)Sealed with this product'skey and unchangedOpensGets the keythe first timeDoesn'topenDevice staysactivatedAll trueAnymissing
What's happeningWhat your app receivesWhat to check
The entitlement named in the file isn't true for this licenseSEALED_FILE_ENTITLEMENT_REQUIREDWhether the policy or the license has an entitlement with the same name set to true
The file was sealed with another product's key, was damaged or was changedSEALED_FILE_INVALIDSeal it again with this product's key and reinstall the file
Usakey can't deliver keys for a momentSEALED_FILE_KEY_UNAVAILABLEOpen it again a little later
Your plan doesn't include sealed filesPLAN_ENTITLEMENT_REQUIREDReturn to the Team plan or above and the same key opens the files again
The license is suspended, revoked or expiredA decision that use isn't allowed (sometimes a code such as LICENSE_SUSPENDED)Not opening is correct. Resume a suspended license, or extend an expired one, and the files open again (a revocation can't be undone)

When Usakey refuses to deliver a key, open the device on the license in the Console: "Requests refused in the last 7 days" shows the reason and how many times it happened. The product app refuses some files itself before connecting (a file for another product, an entitlement that isn't true, and so on). Those don't appear there, so check the code or decision the product app received.

Ask AI to implement or configure

Copy the instruction for your task and paste it into an AI assistant connected to MCP. You can also select the same task from the MCP prompt list. See the product integration page for connection steps. Add license checks to your app

Files opened only by licensed devices
Use the Usakey MCP server and distributed skills for this task. First read the relevant skill VERSION, SKILL.md and references below. If the local MCP cannot serve resources, read the same files from the distribution ZIP advertised by the connected server. Confirm product, environment, language and existing settings; never invent missing values. Use the official SDK in product apps and never embed a Management API key. Keep management operations within the approved access and plan. Keep secrets out of chat, screens and logs. Write expected behavior as tests before implementation and report actual verification and unverified surfaces.

Implement sealing distribution files and opening them with the official SDK on licensed devices. Check Team or above and product settings; include offline files if required. Device administrators can extract opened plaintext, so exclude secrets such as API keys. Test tampering and denied licenses.

References
skill://usakey-auth-integration/references/sealed-files.md

Management tools for configuration and checks
get_product_sealed_files
enable_product_sealed_files
Bundle an executable and its companion files
Use the Usakey MCP server and distributed skills for this task. First read the relevant skill VERSION, SKILL.md and references below. If the local MCP cannot serve resources, read the same files from the distribution ZIP advertised by the connected server. Confirm product, environment, language and existing settings; never invent missing values. Use the official SDK in product apps and never embed a Management API key. Keep management operations within the approved access and plan. Keep secrets out of chat, screens and logs. Write expected behavior as tests before implementation and report actual verification and unverified surfaces.

Check whether usakey-wrap fits the finished executable, then pack it and verify launch. Explain Team-or-above and key-based node-locked restrictions, the absence of deactivation/identity screens, and weaker protection than SDK integration.

Existing single-file pack commands remain supported. For multiple files, confirm the root directory, entrypoint relative to root, optional include paths and output outside root. Omitting include bundles all of root. Obtain settings with get_integration_config and the public sealing key with get_product_sealed_files. Never supply private keys or license-key values as packing arguments.

When the local MCP tools/list contains usakey_wrap_pack, call it with root, entrypoint, include, output, api_url, root_public_key_path and sealing_key. Hosted MCP cannot read the user's files. With only hosted MCP, run the CLI in the user's authorized local development environment. The command shape is: usakey-wrap pack --bundle --entrypoint bin/myapp --include bin/myapp --include lib --include data --out /work/dist/myapp --key <public sealing key> --api-url <API URL> --root-public-key /work/usakey-root.pem --min-trust-seq 1 -- /work/build/myapp. Replace paths and settings with actual values and use a stub for the target OS.

Request example:
```text
Use Usakey MCP and skills to bundle bin/myapp, lib and data from /work/build/myapp into one executable. Launch bin/myapp and write the result to /work/dist/myapp. Do not pass a license-key value; configure the launcher so the user can supply it through the MYAPP_LICENSE environment variable.
```

Verify relative file placement, working directory, arguments, environment, standard streams, exit status, child lifetime and cleanup. Bundles extract plaintext into a private temporary directory on Linux too. Do not promise complete secrecy. Report tests actually run and untested operating systems separately.

References
skill://usakey-auth-integration/references/executable-wrapper.md

Management tools for configuration and checks
get_integration_config
get_product_sealed_files

Screenshots were taken in a test environment with sample data. IDs such as product IDs, license keys, and activation tokens are masked. Some details may change as we improve the screens.