---
title: "Scan code before execution with Weka"
description: "Ask Weka for a calibrated malicious-code probability from source and build signals, then stop execution at your chosen threshold."
slug: "models/weka/use-cases/scan-code-before-execution-with-weka"
sidebar:
  label: "Scan code before execution"
seo:
  canonical: "https://autohand.ai/use-cases/scan-code-before-execution-with-weka/"
---
Scan code before execution with Weka is a Weka typed-decision workflow that ask Weka for a calibrated malicious-code probability from source and build signals, then stop execution at your chosen threshold. It returns a bounded answer and probabilities so application code can keep final policy enforcement deterministic.

## At a glance

| Question | Answer |
| --- | --- |
| Best for | Evaluate suspicious build behavior before it runs |
| Input | Minimal JSON state built from observable evidence |
| Weka returns | A calibrated yes-or-no probability that can block a build before untrusted code executes. Available through the Weka API, Autohand SDK, and Console Playground. |
| Policy boundary | Your code owns thresholds, permissions, retries, audit logs, and the final action |

Weka can evaluate source and build signals before an untrusted script runs. The model is in Public Preview and is available only through the Autohand API, SDK, and Console Playground.

## Build an evidence-only state

Extract observable facts without executing the file: encoded shell fragments, eval paths, network destinations, binary downloads, install hooks, file origin, and the exact lines that produced each signal. Send those facts to Weka as JSON.

## Ask for a calibrated noul

```json
{
  "model": "weka",
  "state": {
    "obfuscated_execution": true,
    "downloads_binary": true,
    "known_source": false,
    "lines": ["scripts/install.js:41", "scripts/install.js:58"]
  },
  "questions": {
    "is_malicious": {
      "type": "noul",
      "instructions": "Would executing this build step create a material security risk?"
    }
  }
}
```

## Enforce the threshold before execution

Block the step when the malicious probability crosses your policy threshold. Route uncertain results and the cited lines to a person. Weka evaluates the evidence; your runner remains responsible for isolation, permissions, and the final allow or deny action.

## Review before accepting

Verify that collection is non-executing, secrets and source are minimized, and the block happens before any package hook, shell command, or downloaded binary runs.

## Source and validation signals

Autohand AI maintains this page as first-party Weka product guidance. Verify the current request contract in the [Weka model guide](/models/weka) and build application flows with the [Autohand SDK](https://autohand.ai/code/sdk/). Community patterns from the [AY Automate Jev builds index](https://www.ayautomate.com/jev-builds) and [dabit3/jev-experiments](https://github.com/dabit3/jev-experiments) informed the use-case taxonomy. Their measurements describe their own Jev implementations and are not Weka benchmarks.

## Frequently asked questions

**What is Scan code before execution with Weka?**

Scan code before execution with Weka is a Weka typed-decision workflow that ask Weka for a calibrated malicious-code probability from source and build signals, then stop execution at your chosen threshold. It returns a bounded answer and probabilities so application code can keep final policy enforcement deterministic.

**When should a team use Scan code before execution with Weka?**

Evaluate suspicious build behavior before it runs. Use it when the next software step needs one bounded decision and the application can preserve the evidence, probability, and policy outcome.

**What does Weka return for this workflow?**

A calibrated yes-or-no probability that can block a build before untrusted code executes. Available through the Weka API, Autohand SDK, and Console Playground.

**Does Weka take the final action?**

No. Weka evaluates the state and returns a typed answer. Application code remains responsible for authorization, thresholds, deterministic safety rules, logging, retries, and the final action.

## Related resources

**[Guide: Weka model guide](/models/weka)**

Learn how to ask calibrated noul questions from structured state.

**[Playground: Console Playground](https://console.autohand.ai/playground/)**

Test security signals and thresholds with a simulated build state.

**[SDK: Autohand SDK](https://autohand.ai/code/sdk/)**

Add the decision request to a scanner or build service.

**[Samples: Weka samples on GitHub](https://github.com/autohandai/weka-samples)**

Run typed release, CI, patch, data, research, and Code Agent SDK examples.

## API request starter

```text
POST /v1/decisions with model "weka", source and build signals, and an is_malicious noul question
```
