---
id: connectors/source-scanning
title: Authorised project source scans with Wiz
summary: Use the shared scanner runtime from a CLI or a host worker with portable configuration and explicit source ownership.
keywords: connectors, integrations, wiz, security, source, scanning, cli, worker, cancellation
requires: @jskit-ai/connectors-core, @jskit-ai/connectors-catalog
---

# Authorised project source scans with Wiz

## Use when

A CLI or host needs to scan an authorised source snapshot with its own Wiz account.
`createWizScanner` implements configuration checks, command construction,
credential isolation, bounded process execution, report validation and cleanup.
The example wires that library to application-owned authority and snapshot lookup.

## Do not use when

This is not an HTTP application-data connector, user login, a managed gateway,
or an implementation of a hosted editor's coding agents. It does not generate an app.
Auth0 and native Windows execution are not implemented in the current runner.

## Product decisions

The host chooses which principals may scan which projects, the stable application
and shared subject identities, snapshot lifetime, worker resource/network limits,
Wiz policies and authorised report readers. It decides how to display findings
and whether a blocking verdict prevents a later operation.

## Invariants

- CLI and UI edit the same reference-only `integrations.json`.
- Browser input never supplies a source path, executable, environment or identity.
- The host checks access before resolving source and credentials.
- The snapshot must remain immutable while the scan runs; keep its revision with
  the findings and mark the result stale when current source differs.
- A passed policy verdict is not a proof that there are no vulnerabilities.
- Missing/invalid reports, cancellation and failed scans never become clean scans.
- Provider credentials are isolated from coding-agent sessions and credentials.
- The host supplies its own authorized provider credentials; editor edition does
  not select a shared hosted provider account.
- Each collaborator the composition receives (`authorize`, `resolveReference`
  and `resolveScanTarget`) is a required parameter typed in a JSDoc `@param` and
  called directly, without a `typeof` probe, a "requires x" guard or a no-op
  default. `authorize` and `resolveReference` are typed with `ConnectorAuthorize`
  and `ResolveReference` from `@jskit-ai/connectors-core/server/types`, and
  `resolveScanTarget` with `WizScanTargetResolver` from
  `@jskit-ai/connectors-catalog/server/types`. A server feature that uses it follows
  [typed features](https://github.com/mobily-enterprises/jskit-ai/blob/main/packages/agent-docs/site/guide/framework/typed-features.md).

## Framework APIs

Use `parseIntegrationConfiguration` from connectors-core/shared/configuration,
`wizDefinition` from connectors-catalog/shared, and `createWizScanner` from
connectors-catalog/server/wiz. Supply the host's `authorize`, `resolveReference`,
`resolveScanTarget` and installed CLI absolute path. The runtime's `scan` operation
accepts only context, integration ID and an optional AbortSignal.
See [Wiz setup and limits](https://github.com/mobily-enterprises/jskit-ai/blob/main/packages/connectors-catalog/docs/wiz.md).

## Example files

`source-scanner.js` reads a normal text configuration file and returns the scanner.
Both an authenticated HTTP handler and an ordinary CLI command can call it.
Its callbacks belong to the application; do not replace them with unconditional
approval in a multi-user service. Do not run this example merely to validate source.

## Variation points

CLI commands can use local user authority; a server uses its workspace/project
policy. Hosts may set the deadline, report-size limit, proxy and CA environment
for an isolated worker. Snapshot creation and findings storage stay host-owned.

A Laravel application can use a PHP worker to invoke the same installed Wiz CLI
or call an explicitly configured scan worker over HTTP. It reads ordinary JSON
and needs no Node/JSKIT runtime. That PHP or HTTP implementation owns its process
and identity boundary; this package supplies a working JavaScript implementation
and documents the protocol, not an already implemented PHP library or gateway.

## Verification

Use a controlled executable and temporary source to verify command arguments,
isolated credentials, policy results, malformed reports, cancellation and cleanup.
Editor checks cover all configuration fields and persistence. Actual authentication
and findings require separately authorised provider acceptance.

## Avoid

Do not infer workspace grants from a shared slot, return raw provider stderr,
replay scans automatically, pass arbitrary CLI flags, use a mutable working tree
as if it were a fixed revision, or substitute a generic API reader for source scans.

Do not probe a collaborator, default one to `null`, `{}` or a no-op, fill a slot
with a setter after construction, or keep a module-level registry.
