MCPcopy Create free account

hub / github.com/MetapriseAI/OrgKernel / functions

Functions158 in github.com/MetapriseAI/OrgKernel

Functionappend_entry
Append an entry to an AuditChain. The chain must not be closed. Call /audit/{chain_id}/close when done.
src/orgkernel/pyapi/router.py:693
Methodblocked
(self)
src/orgkernel/schemas/execution_token.py:90
Functioncheck_scope
Validate a tool call against an ExecutionToken's scope. Called by the Tool Gateway before every external tool call. Returns whether
src/orgkernel/pyapi/router.py:513
Methodcheck_scope
Validate a proposed tool call against this token's scope. Called by Tool Gateway before every external call. Returns Scope
src/orgkernel/schemas/execution_token.py:204
Methodclose
Close the chain. No further entries may be appended. Call at Mission CLOSED state.
src/orgkernel/schemas/audit_chain.py:236
Functionclose_chain
Close an AuditChain. Writes the terminal entry and marks the chain as closed. Call this when a mission enters the CLOSED state.
src/orgkernel/pyapi/router.py:731
Functionclose_db
Close the global async engine. Call at application shutdown.
src/orgkernel/database.py:99
Methodentries_by_event
Return all entries whose event starts with event_prefix.
src/orgkernel/schemas/audit_chain.py:276
Methodentries_by_layer
Return all entries for a given layer.
src/orgkernel/schemas/audit_chain.py:272
Methodget_active_identity
Get an AgentIdentity only if currently ACTIVE and not expired.
src/orgkernel/services/agent_identity_service.py:692
Methodget_active_token_by_agent
Get the most recently issued active ExecutionToken for an agent. Unlike ``get_active_token(mission_id)`` which requires a mission
src/orgkernel/services/execution_token_service.py:241
Functionget_active_token_by_mission
Get the active ExecutionToken for a mission.
src/orgkernel/pyapi/router.py:570
Functionget_certificate
Get the AgentCertificate for an identity. Note: The certificate is issued at creation time. This endpoint reconstructs the certifica
src/orgkernel/pyapi/router.py:201
Functionget_chain
Get an AuditChain by chain_id.
src/orgkernel/pyapi/router.py:781
Functionget_chain_by_mission
Get the AuditChain for a mission.
src/orgkernel/pyapi/router.py:763
Functionget_db
Override this with your actual session dependency.
src/orgkernel/pyapi/router.py:75
Functionget_engine
Create an async SQLAlchemy engine from a database URL. Args: url: Database connection URL. Examples:
src/orgkernel/database.py:44
Functionget_identity
Get an AgentIdentity by agent_id.
src/orgkernel/pyapi/router.py:168
Functionget_session_factory
Return a session factory bound to the given engine. Usage:: factory = get_session_factory(engine) async with factory(
src/orgkernel/database.py:62
Functionget_token
Get an ExecutionToken by token_id.
src/orgkernel/pyapi/router.py:479
Functioninit_db
Create all OrgKernel tables in the database. Call this once at application startup (after setting the engine URL). Args:
src/orgkernel/database.py:76
Methodinitialize
Create a new AuditChain and write the genesis IDENTITY entry. Call at Mission CREATED state.
src/orgkernel/schemas/audit_chain.py:185
Functioninitialize_chain
Initialize a new AuditChain for a mission. Creates the chain header and writes the genesis IDENTITY entry. Call this when a mission
src/orgkernel/pyapi/router.py:669
Methodinvalidate
Return a new invalidated token.
src/orgkernel/schemas/execution_token.py:233
Functioninvalidate_token
Invalidate a token early with a reason.
src/orgkernel/pyapi/router.py:551
Methodis_active
True if identity is ACTIVE and not expired.
src/orgkernel/schemas/agent_identity.py:157
Methodis_expired
True if token has passed its expires_at timestamp.
src/orgkernel/schemas/execution_token.py:189
Methodis_valid
True if token is not expired, not used, and not invalidated.
src/orgkernel/schemas/execution_token.py:194
Methodis_valid_status
Check if status is ACTIVE (not revoked/suspended/expired).
src/orgkernel/schemas/agent_identity.py:337
Functionissue_from_csr
Issue an AgentIdentity from a validated CSR. The agent receives: - identity: DB record (server-side only) - certificate
src/orgkernel/pyapi/router.py:127
Functionissue_identity
Issue a new AgentIdentity (legacy method).
src/orgkernel/pyapi/router.py:153
Methodlist_by_agent
List all ExecutionTokens for an agent.
src/orgkernel/services/execution_token_service.py:336
Methodlist_by_mission
List all ExecutionTokens for a mission.
src/orgkernel/services/execution_token_service.py:326
Functionlist_identities_by_org
List all AgentIdentities for an organization.
src/orgkernel/pyapi/router.py:388
Functionmark_token_used
Mark a token as consumed (used=True).
src/orgkernel/pyapi/router.py:533
Methodmark_used
Return a new token marked as consumed.
src/orgkernel/schemas/execution_token.py:240
Functionmint_token
Mint a new ExecutionToken. The token is: - Scoped to agent_id + mission_id - Signed by the Org CA (prevents Token Graft
src/orgkernel/pyapi/router.py:456
Functionpage_chains_by_agent
Paginated list of AuditChains for an agent (chain metadata only).
src/orgkernel/pyapi/router.py:827
Functionpage_identities_by_org
Paginated list of AgentIdentities for an organization.
src/orgkernel/pyapi/router.py:423
Functionpage_tokens_by_agent
Paginated list of ExecutionTokens for an agent.
src/orgkernel/pyapi/router.py:620
Functionpage_tokens_by_mission
Paginated list of ExecutionTokens for a mission.
src/orgkernel/pyapi/router.py:603
Methodreactivate
Return a new AgentIdentity with ACTIVE status. Only valid from SUSPENDED. REVOKED identities cannot be reactivated.
src/orgkernel/schemas/agent_identity.py:178
Functionreactivate_identity
Reactivate a suspended AgentIdentity.
src/orgkernel/pyapi/router.py:351
Functionrequest_challenge
Generate and store a cryptographic challenge for an agent. The returned ChallengeRequest.nonce must be sent to the agent. The agent
src/orgkernel/pyapi/router.py:285
Methodrespond_challenge
Validate a challenge response from an agent. Step 5: Agent sends back the signed nonce. This verifies: 1. C
src/orgkernel/services/agent_identity_service.py:475
Methodrevoke
Return a new AgentIdentity with REVOKED status.
src/orgkernel/schemas/agent_identity.py:165
Functionrevoke_identity
Permanently revoke an AgentIdentity.
src/orgkernel/pyapi/router.py:369
Functionsign_token_payload
Sign ExecutionToken payload with the Org CA private key. Args: private_key_pem: Org CA PKCS8 PEM private key. token_data: Di
src/orgkernel/crypto_utils.py:196
Functionsubmit_csr
Submit a Certificate Signing Request for agent identity issuance.
src/orgkernel/pyapi/router.py:109
Methodsuspend
Return a new AgentIdentity with SUSPENDED status.
src/orgkernel/schemas/agent_identity.py:174
Functionsuspend_identity
Suspend an AgentIdentity (recoverable).
src/orgkernel/pyapi/router.py:333
Methodto_signable_payload
Return canonical JSON for CA signing / verification.
src/orgkernel/schemas/agent_identity.py:316
Methodto_signable_payload
Return canonical JSON for signing / verification. This payload is what the Org CA signs to issue the token. Any field tamp
src/orgkernel/schemas/execution_token.py:168
Methodverify_certificate
Verify an AgentCertificate's CA signature. Args: certificate: The AgentCertificate to verify. ca_public
src/orgkernel/services/agent_identity_service.py:414
Functionverify_chain
Verify the integrity of an AuditChain. Checks: 1. Each entry's entry_hash is consistent 2. Each entry's prev_hash links
src/orgkernel/pyapi/router.py:799
Functionverify_challenge
Full challenge-response verification. Verifies: 1. Challenge exists, not expired, and not already used 2. Agent's signa
src/orgkernel/pyapi/router.py:311
Functionverify_identity
Static verification of an AgentIdentity (status + expiry).
src/orgkernel/pyapi/router.py:270
Methodverify_integrity
Verify the entire chain from genesis to head. Returns True if no tampering detected. Checks: 1. Each entry's en
src/orgkernel/schemas/audit_chain.py:250
← previous101–158 of 158, ranked by callers