Skip to content
Back to skills

Masked Program Embedding

ASecurity

Build BAR-style masked target embeddings and universal tanh-bounded programs while preserving protected target-domain data.

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
testingpython

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill masked_program_embedding --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Masked Program Embedding?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Masked Program Embedding
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-masked-program-embedding/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-masked-program-embedding)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
name: masked_program_embedding
description: Build BAR-style masked target embeddings and universal tanh-bounded programs while preserving protected target-domain data.
---

# Masked Program Embedding

Use this skill when implementing adversarial reprogramming or a BAR proxy experiment that must embed smaller target-domain arrays in a larger source-domain input and add a universal program only outside the protected region.

Do not use it for ordinary data augmentation or for perturbations that are allowed to alter the target sample content.

## Inputs

- A batch of same-shaped numeric target samples.
- A source canvas shape with the same rank as each sample.
- An embedding offset, or `None` to center the sample.
- Program parameters `W` with the source canvas shape.

## Outputs

- Embedded batch `X`.
- Binary mask `M`, with `0` on target data and `1` on programmable cells.
- Program `P = tanh(W*M)`.
- Programmed batch `X + P`.

## Workflow

1. Validate that every target sample fits inside the source canvas.
2. Place every target sample at the same offset in a zero canvas.
3. Construct a mask that protects exactly the embedded target region.
4. Apply the universal tanh-bounded program outside that region.
5. Verify protected values are unchanged before passing data to a black-box model.

## Validation

Run `python tests/test_masked_program_embedding.py` or validate the skill tree with `validate_skill_tree.py --run-tests`.

## Limitations

This skill does not choose label mappings or optimize `W`; it only provides the input transformation contract used by BAR.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…