Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/MetapriseAI/OrgKernel
/ functions
Functions
158 in github.com/MetapriseAI/OrgKernel
⨍
Functions
158
◇
Types & classes
35
↳
Endpoints
28
Function
append_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
Method
blocked
(self)
src/orgkernel/schemas/execution_token.py:90
Function
check_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
Method
check_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
Method
close
Close the chain. No further entries may be appended. Call at Mission CLOSED state.
src/orgkernel/schemas/audit_chain.py:236
Function
close_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
Function
close_db
Close the global async engine. Call at application shutdown.
src/orgkernel/database.py:99
Method
entries_by_event
Return all entries whose event starts with event_prefix.
src/orgkernel/schemas/audit_chain.py:276
Method
entries_by_layer
Return all entries for a given layer.
src/orgkernel/schemas/audit_chain.py:272
Method
get_active_identity
Get an AgentIdentity only if currently ACTIVE and not expired.
src/orgkernel/services/agent_identity_service.py:692
Method
get_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
Function
get_active_token_by_mission
Get the active ExecutionToken for a mission.
src/orgkernel/pyapi/router.py:570
Function
get_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
Function
get_chain
Get an AuditChain by chain_id.
src/orgkernel/pyapi/router.py:781
Function
get_chain_by_mission
Get the AuditChain for a mission.
src/orgkernel/pyapi/router.py:763
Function
get_db
Override this with your actual session dependency.
src/orgkernel/pyapi/router.py:75
Function
get_engine
Create an async SQLAlchemy engine from a database URL. Args: url: Database connection URL. Examples:
src/orgkernel/database.py:44
Function
get_identity
Get an AgentIdentity by agent_id.
src/orgkernel/pyapi/router.py:168
Function
get_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
Function
get_token
Get an ExecutionToken by token_id.
src/orgkernel/pyapi/router.py:479
Function
init_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
Method
initialize
Create a new AuditChain and write the genesis IDENTITY entry. Call at Mission CREATED state.
src/orgkernel/schemas/audit_chain.py:185
Function
initialize_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
Method
invalidate
Return a new invalidated token.
src/orgkernel/schemas/execution_token.py:233
Function
invalidate_token
Invalidate a token early with a reason.
src/orgkernel/pyapi/router.py:551
Method
is_active
True if identity is ACTIVE and not expired.
src/orgkernel/schemas/agent_identity.py:157
Method
is_expired
True if token has passed its expires_at timestamp.
src/orgkernel/schemas/execution_token.py:189
Method
is_valid
True if token is not expired, not used, and not invalidated.
src/orgkernel/schemas/execution_token.py:194
Method
is_valid_status
Check if status is ACTIVE (not revoked/suspended/expired).
src/orgkernel/schemas/agent_identity.py:337
Function
issue_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
Function
issue_identity
Issue a new AgentIdentity (legacy method).
src/orgkernel/pyapi/router.py:153
Method
list_by_agent
List all ExecutionTokens for an agent.
src/orgkernel/services/execution_token_service.py:336
Method
list_by_mission
List all ExecutionTokens for a mission.
src/orgkernel/services/execution_token_service.py:326
Function
list_identities_by_org
List all AgentIdentities for an organization.
src/orgkernel/pyapi/router.py:388
Function
mark_token_used
Mark a token as consumed (used=True).
src/orgkernel/pyapi/router.py:533
Method
mark_used
Return a new token marked as consumed.
src/orgkernel/schemas/execution_token.py:240
Function
mint_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
Function
page_chains_by_agent
Paginated list of AuditChains for an agent (chain metadata only).
src/orgkernel/pyapi/router.py:827
Function
page_identities_by_org
Paginated list of AgentIdentities for an organization.
src/orgkernel/pyapi/router.py:423
Function
page_tokens_by_agent
Paginated list of ExecutionTokens for an agent.
src/orgkernel/pyapi/router.py:620
Function
page_tokens_by_mission
Paginated list of ExecutionTokens for a mission.
src/orgkernel/pyapi/router.py:603
Method
reactivate
Return a new AgentIdentity with ACTIVE status. Only valid from SUSPENDED. REVOKED identities cannot be reactivated.
src/orgkernel/schemas/agent_identity.py:178
Function
reactivate_identity
Reactivate a suspended AgentIdentity.
src/orgkernel/pyapi/router.py:351
Function
request_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
Method
respond_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
Method
revoke
Return a new AgentIdentity with REVOKED status.
src/orgkernel/schemas/agent_identity.py:165
Function
revoke_identity
Permanently revoke an AgentIdentity.
src/orgkernel/pyapi/router.py:369
Function
sign_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
Function
submit_csr
Submit a Certificate Signing Request for agent identity issuance.
src/orgkernel/pyapi/router.py:109
Method
suspend
Return a new AgentIdentity with SUSPENDED status.
src/orgkernel/schemas/agent_identity.py:174
Function
suspend_identity
Suspend an AgentIdentity (recoverable).
src/orgkernel/pyapi/router.py:333
Method
to_signable_payload
Return canonical JSON for CA signing / verification.
src/orgkernel/schemas/agent_identity.py:316
Method
to_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
Method
verify_certificate
Verify an AgentCertificate's CA signature. Args: certificate: The AgentCertificate to verify. ca_public
src/orgkernel/services/agent_identity_service.py:414
Function
verify_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
Function
verify_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
Function
verify_identity
Static verification of an AgentIdentity (status + expiry).
src/orgkernel/pyapi/router.py:270
Method
verify_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
← previous
101–158 of 158, ranked by callers