Interactive lab ↗
v0.2 research preview

Connect to the idea.
Don't join another silo.

SAP's first working primitive compares declared AI execution alternatives against constraints that matter: task quality, local-only privacy, optional human review, disclosed cost, and energy evidence. The integration is voluntary and local-first.

Scope: This is a prototype decision helper, not a ratified protocol, energy meter, model router, or automatic enforcement layer. You must provide options and evidence, connect the result to your own execution code, and independently verify real outcomes.

1. Use the zero-dependency core

For JavaScript applications, download sap-core.js or copy it from GitHub. No API key, account, build step, or network permission is required.

const SAP = require("./sap-core");

const options = [
  {
    id: "local",
    location: "local",
    quality: 0.85,        // application-supplied proxy
    costUSD: 0.01,
    latencyMs: 1300,
    energyKwh: null,     // do not invent measurements
    energyEvidence: "unknown"
  },
  {
    id: "cloud",
    location: "remote",
    quality: 0.92,
    costUSD: 0.005,
    latencyMs: 600,
    energyKwh: null,
    energyEvidence: "unknown"
  }
];

const plan = SAP.evaluate(options, {
  mode: "balanced",
  minimumQuality: 0.8,
  localOnly: true
});

console.log(plan.selected?.id); // "local"
console.log(plan.reason);
// No remote call has been made.

The same file can be loaded in a browser with a normal script tag, where it exposes window.SAPCore.

2. Distinguish truth from assumptions

// A receipt can describe a plan, not prove success.
const receipt = SAP.makeReceipt(plan.selected, {
  status: "planned",
  demo: false
});

// Never mark an outcome "verified" without
// an external verification reference.

Working interchange specification and conformance

SAP now has a transport-independent working draft for exchanging execution offers, policy decisions, and outcome receipts. It includes a JSON Schema 2020-12 wire contract, interactive protocol documentation, and adversarial test fixtures.

Validation is available in JavaScript and Python. A standalone Python producer and JavaScript consumer exchange this format directly without relying on a SAP-specific server.

npm --prefix protocol install
node protocol/validate.cjs --fixtures
python -m pip install jsonschema
python protocol/validate.py
node --test examples/sap-exchange.test.cjs

Run the cross-language example ↗ · Governance proposal · Verified status

Not yet ratified: Third-party adoption, real hardware measurements, independent security assessment and broader ecosystem interoperability are still open research milestones.

3. Test and challenge the contract

node --test test-sap-core.js test-homepage.cjs

The project also includes the draft technical specification, an architectural vision, and a hands-on lab.

Tested interoperability pilot

Two independent local apps now exchange standard OpenTelemetry OTLP JSON traces through a SAP adapter. A Green Software Foundation Impact Framework manifest runs through the real IF engine in automated tests. These tests use fictional environmental inputs and do not establish real-world energy or carbon savings.

Inspect the tested adapters and run instructions ↗

Actual whole-workload energy metering, live carbon-intensity feeds, and an OSF integration remain pending. This pilot is not a hosted SAP API.

What's next?

Our working-draft format implements evidence-carrying offers, decisions and receipts. Proving its incremental value against existing standards remains an explicit research goal. The real telemetry and IF adapters are implemented in the local pilot; broader runtime, environmental data, and ecosystem integrations are future work.

Help evaluate the need for a new standard, bring measured examples, or point us to an existing system we should integrate instead of rebuilding.

Propose an integration ↗