EQTY LabDocs

Declare how an agent meets assessment controls

Add a declaration with a written statement to an assessment's draft, as a project declaration is made: it covers the controls it names, so one declaration can serve several controls. Configuration fields a control is judged against come from the pinned configuration, so no declaration provides them. Add files with declarations/with-file. The declaration is registered with the Integrity Service as a governance statement in the assessment's graph, signed by the caller. Declarations are never changed: remove one and add another. A submission keeps the declarations it froze. Only the member who started the assessment may declare; an integration's API key bound to no project acts as its owner with full access or the submit_agent_assessments scope

posthttps://localhost:10001/api/v1/organizations/{orgId}/assessments/{assessmentId}/declarations
bash
curl --request POST \
  --url 'https://localhost:10001/api/v1/organizations/{orgId}/assessments/{assessmentId}/declarations' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{"controls":["AGT-1"],"statement":"The agent may only read the repository and run its test suite."}'
javascript
const response = await fetch("https://localhost:10001/api/v1/organizations/{orgId}/assessments/{assessmentId}/declarations", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "controls": [
      "AGT-1"
    ],
    "statement": "The agent may only read the repository and run its test suite."
  })
});

const data = await response.json();
typescript
interface AssessmentDeclaration {
  attachments?: Record<string, unknown>[];
  controls?: string[];
  documentCid?: string;
  statement?: string;
  statementId?: string;
  submittedAt?: string;
  submittedBy?: string;
  submittedByDid?: string;
  submittedByUserId?: string;
  uuid?: string;
}

const response = await fetch("https://localhost:10001/api/v1/organizations/{orgId}/assessments/{assessmentId}/declarations", {
  method: "POST",
  headers: {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    "controls": [
      "AGT-1"
    ],
    "statement": "The agent may only read the repository and run its test suite."
  })
});
if (!response.ok) throw new Error(`${response.status} ${response.statusText}`);

const data: AssessmentDeclaration = await response.json();
python
import requests

response = requests.post(
    "https://localhost:10001/api/v1/organizations/{orgId}/assessments/{assessmentId}/declarations",
    headers={
        "Authorization": "Bearer <token>",
        "Content-Type": "application/json",
    },
    json={
        "controls": [
            "AGT-1",
        ],
        "statement": "The agent may only read the repository and run its test suite.",
    },
)
response.raise_for_status()
print(response.json())
go
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{
	  "controls": [
	    "AGT-1"
	  ],
	  "statement": "The agent may only read the repository and run its test suite."
	}`)
	req, err := http.NewRequest(http.MethodPost, "https://localhost:10001/api/v1/organizations/{orgId}/assessments/{assessmentId}/declarations", body)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer <token>")
	req.Header.Set("Content-Type", "application/json")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	data, err := io.ReadAll(res.Body)
	if err != nil {
		panic(err)
	}
	fmt.Println(res.Status, string(data))
}
java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
    public static void main(String[] args) throws Exception {
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://localhost:10001/api/v1/organizations/{orgId}/assessments/{assessmentId}/declarations"))
            .header("Authorization", "Bearer <token>")
            .header("Content-Type", "application/json")
            .method("POST", HttpRequest.BodyPublishers.ofString("""
                {
                  "controls": [
                    "AGT-1"
                  ],
                  "statement": "The agent may only read the repository and run its test suite."
                }
                """))
            .build();

        HttpResponse<String> response = HttpClient.newHttpClient()
            .send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.statusCode() + " " + response.body());
    }
}
csharp
using System.Net.Http.Headers;
using System.Text;

using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://localhost:10001/api/v1/organizations/{orgId}/assessments/{assessmentId}/declarations");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", "<token>");
request.Content = new StringContent("""
    {
      "controls": [
        "AGT-1"
      ],
      "statement": "The agent may only read the repository and run its test suite."
    }
    """, Encoding.UTF8, "application/json");

using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
php
<?php

$ch = curl_init('https://localhost:10001/api/v1/organizations/{orgId}/assessments/{assessmentId}/declarations');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer <token>',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => <<<'JSON'
    {
      "controls": [
        "AGT-1"
      ],
      "statement": "The agent may only read the repository and run its test suite."
    }
    JSON,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status . " " . $response . PHP_EOL;
ruby
require "net/http"

uri = URI("https://localhost:10001/api/v1/organizations/{orgId}/assessments/{assessmentId}/declarations")
request = Net::HTTP::Post.new(uri)
request["Authorization"] = "Bearer <token>"
request["Content-Type"] = "application/json"
request.body = <<~'JSON'
  {
    "controls": [
      "AGT-1"
    ],
    "statement": "The agent may only read the repository and run its test suite."
  }
JSON

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
puts "#{response.code} #{response.body}"
rust
// Cargo.toml dependencies: reqwest (features "json"), serde_json, tokio (features "full")
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let response = reqwest::Client::new()
        .post("https://localhost:10001/api/v1/organizations/{orgId}/assessments/{assessmentId}/declarations")
        .header("Authorization", "Bearer <token>")
        .json(&json!({
            "controls": [
                "AGT-1"
            ],
            "statement": "The agent may only read the repository and run its test suite."
        }))
        .send()
        .await?;

    println!("{} {}", response.status(), response.text().await?);
    Ok(())
}

Authorizations

  • BearerAuth · API key in header "Authorization" — Type "Bearer" followed by a space and JWT token.

Parameters

Path parameters

NameTypeDescription
orgId
required
string

Organization ID or UUID (urn:uuid optional)

assessmentId
required
string

Assessment UUID (urn:uuid optional)

Request bodyrequired

The statement and the controls it covers

application/json
  • controlsstring[]required

    Control codes it covers, at least one

  • statementstring
Examplejson
{
  "controls": [
    "AGT-1"
  ],
  "statement": "The agent may only read the repository and run its test suite."
}

Responses

201Declaration

application/json
  • attachmentscore.AssessmentAttachment[]
    Show properties

    Array of core.AssessmentAttachment

    • cidstring

      urn:cid of the bytes, registered with the Integrity Service

    • contentTypestring
    • fileNamestring
    • idinteger

      The file, for its assessment's declaration file routes

    • sizeBytesinteger
  • controlsstring[]

    The control codes it covers, in the program's order

  • documentCidstringread-only

    urn:cid of the declaration document the Integrity Service stored

  • statementstring
  • statementIdstringread-only

    urn:cid of the governance statement it registered as

  • submittedAtstring<date-time>read-only
  • submittedBystringread-only
  • submittedByDidstringread-only
  • submittedByUserIdstringread-only
  • uuidstringread-only

    urn:uuid form

Examplejson
{
  "attachments": [
    {
      "cid": "string",
      "contentType": "string",
      "fileName": "string",
      "id": 0,
      "sizeBytes": 0
    }
  ],
  "controls": [
    "string"
  ],
  "documentCid": "string",
  "statement": "string",
  "statementId": "string",
  "submittedAt": "2025-01-01T00:00:00Z",
  "submittedBy": "string",
  "submittedByDid": "string",
  "submittedByUserId": "string",
  "uuid": "string"
}

400Bad request - Invalid request, or no control of the program covered

application/json
  • errorstring
Examplejson
{
  "error": "Invalid request body"
}

401Unauthorized - Authentication required

application/json
  • errorstring
Examplejson
{
  "error": "Invalid request body"
}

403Forbidden - Not the assessment's starter, an API key with neither full access nor submit_agent_assessments, or a project-bound key

application/json
  • errorstring
Examplejson
{
  "error": "Invalid request body"
}

404Assessment not found

application/json
  • errorstring
Examplejson
{
  "error": "Invalid request body"
}

500Internal server error

application/json
  • errorstring
Examplejson
{
  "error": "Invalid request body"
}