
Research
/Security News
npm Package Uses Prompt Injection and Token Flooding to Disrupt AI Malware Scanners
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.
@isl-lang/contract-testing
Advanced tools
Contract testing framework for ISL specifications that validates implementations match ISL behaviors using scenario-based tests.
scenarios blocksdomain UserAuthentication {
behavior Login {
input {
email: String
password: String
}
output {
success: Session
errors {
INVALID_CREDENTIALS { when: "Email or password is incorrect" }
}
}
}
scenarios Login {
scenario "successful login" {
given {
email = "alice@example.com"
password = "password123"
}
when {
result = Login(email: email, password: password)
}
then {
result is success
result.id != null
}
}
scenario "invalid credentials" {
given {
email = "alice@example.com"
password = "wrongpassword"
}
when {
result = Login(email: email, password: password)
}
then {
result is failure
result.error == INVALID_CREDENTIALS
}
}
}
}
import { describe, it, expect, beforeEach } from 'vitest';
import { ContractTestHarness } from '@isl-lang/contract-testing';
import { ScenarioParser } from '@isl-lang/contract-testing';
import { readFileSync } from 'fs';
describe('Login Contract Tests', () => {
let harness: ContractTestHarness;
let parser: ScenarioParser;
beforeEach(() => {
harness = new ContractTestHarness();
parser = new ScenarioParser();
// Bind behavior to handler
harness.bindBehavior('Login', async (input) => {
// Your implementation
return { success: true, id: 'session-123' };
});
});
it('successful login', async () => {
const islContent = readFileSync('auth.isl', 'utf-8');
const parsed = parser.parseScenarios(islContent);
const scenarios = parsed.find(p => p.behaviorName === 'Login');
const scenario = scenarios?.scenarios.find(s => s.name === 'successful login');
const testCase = harness.scenarioToTestCase(scenario!);
const result = await harness.runTestCase(testCase);
expect(result.passed).toBe(true);
});
});
pnpm test:contracts
Main harness for running contract tests.
const harness = new ContractTestHarness({
timeout: 5000, // Test timeout in ms
verbose: false // Enable verbose output
});
// Bind behavior to handler
harness.bindBehavior('Login', async (input) => {
// Implementation
});
// Convert scenario to test case
const testCase = harness.scenarioToTestCase(scenario);
// Run test case
const result = await harness.runTestCase(testCase);
Parse ISL files and extract scenarios.
const parser = new ScenarioParser();
const parsed = parser.parseScenarios(islContent);
// Returns array of ParsedScenarios
// Each contains behaviorName and scenarios array
Use in-memory adapters for testing without external services.
import { InMemoryAuthAdapter } from '@isl-lang/contract-testing';
const adapter = new InMemoryAuthAdapter();
const user = await adapter.createUser('test@example.com', 'hash_password');
Available adapters:
InMemoryAuthAdapter - Authentication operationsInMemoryPaymentAdapter - Payment operationsInMemoryUserAdapter - User management operationsTests follow the ISL scenario structure:
result is success - Behavior succeededresult is failure - Behavior failedresult.error == ERROR_NAME - Specific error coderesult.field == value - Property comparisonEntity.field == value - Entity property comparisonSee tests/ directory for complete examples:
auth.contract.test.ts - Authentication domain testspayments.contract.test.ts - Payments domain testsusers.contract.test.ts - User management tests# Run all contract tests
pnpm test:contracts
# Run tests for specific package
pnpm --filter @isl-lang/contract-testing test
✅ pnpm test:contracts runs and produces readable failures
✅ Tests can run without needing external services (mocked adapters)
✅ Scenarios are extracted from ISL files
✅ Tests validate expected outputs and postconditions
FAQs
Contract testing framework for ISL specifications
The npm package @isl-lang/contract-testing receives a total of 8 weekly downloads. As such, @isl-lang/contract-testing popularity was classified as not popular.
We found that @isl-lang/contract-testing demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.

Product
Socket now detects supply chain risks in project manifests, starting with missing lockfiles that can make dependency installs non-reproducible.

Research
/Security News
The trojanized extensions use TinyGo-compiled WebAssembly and Solana transaction memos to resolve command-and-control infrastructure.